Create Rl Training Job
curl --request POST \
--url https://api.training.wandb.ai/v1/preview/training-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trajectory_groups": [
{
"trajectories": [
{
"exchanges": {
"chat_completions": [
{
"request": {
"model": "<string>",
"messages": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"stream": true,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
},
"type": "<string>"
}
],
"max_completion_tokens": 123,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": true,
"top_logprobs": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"annotations": [
{
"type": "<string>",
"url_citation": {
"end_index": 123,
"start_index": 123,
"title": "<string>",
"url": "<string>"
}
}
],
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"function_call": {
"arguments": "<string>",
"name": "<string>"
},
"tool_calls": [
{
"id": "<string>",
"function": {
"arguments": "<string>",
"name": "<string>"
},
"type": "<string>"
}
]
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
],
"bytes": [
123
]
}
],
"refusal": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
],
"bytes": [
123
]
}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"completions": [
{
"request": {
"model": "<string>",
"prompt": "<string>",
"stream": true,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": 123,
"echo": true,
"stop": "<string>",
"seed": 123
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"text": "<string>",
"logprobs": {
"text_offset": [
123
],
"token_logprobs": [
123
],
"tokens": [
"<string>"
],
"top_logprobs": [
{}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"responses": [
{
"request": {
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": true,
"tools": [
{
"name": "<string>",
"parameters": {},
"strict": true,
"type": "<string>",
"description": "<string>"
}
],
"max_output_tokens": 123,
"temperature": 123,
"top_p": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"created_at": 123,
"model": "<string>",
"object": "<string>",
"output": [
{
"id": "<string>",
"content": [
{
"annotations": [
{
"file_id": "<string>",
"filename": "<string>",
"index": 123,
"type": "<string>"
}
],
"text": "<string>",
"type": "<string>",
"logprobs": [
{
"token": "<string>",
"bytes": [
123
],
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"bytes": [
123
],
"logprob": 123
}
]
}
]
}
],
"role": "<string>",
"type": "<string>"
}
],
"parallel_tool_calls": true,
"tools": [
{
"name": "<string>",
"type": "<string>",
"parameters": {},
"strict": true,
"description": "<string>"
}
],
"error": {
"message": "<string>"
},
"incomplete_details": {},
"instructions": "<string>",
"metadata": {},
"temperature": 123,
"top_p": 123,
"background": true,
"conversation": {
"id": "<string>"
},
"max_output_tokens": 123,
"max_tool_calls": 123,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"text": {
"format": {
"type": "<string>"
}
},
"top_logprobs": 123,
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
},
"total_tokens": 123
},
"user": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"messages": [
{
"request": {
"model": "<string>",
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 123,
"stream": true,
"system": "<string>",
"tools": [
{
"input_schema": {
"type": "<string>",
"properties": {},
"required": [
"<string>"
]
},
"name": "<string>",
"allowed_callers": [],
"cache_control": {
"type": "<string>"
},
"defer_loading": true,
"description": "<string>",
"eager_input_streaming": true,
"input_examples": [
{}
],
"strict": true,
"type": "<string>"
}
],
"thinking": {
"budget_tokens": 123,
"type": "<string>"
},
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stop_sequences": [
"<string>"
],
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"content": [
{
"text": "<string>",
"type": "<string>",
"citations": [
{
"cited_text": "<string>",
"document_index": 123,
"end_char_index": 123,
"start_char_index": 123,
"type": "<string>",
"document_title": "<string>",
"file_id": "<string>"
}
]
}
],
"role": "<string>",
"type": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"inference_geo": "<string>",
"output_tokens_details": {
"thinking_tokens": 123
},
"server_tool_use": {
"web_fetch_requests": 123,
"web_search_requests": 123
}
},
"container": {
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"stop_details": {
"type": "<string>",
"explanation": "<string>"
},
"stop_sequence": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
]
},
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
},
"type": "<string>"
}
],
"additional_histories": [
{
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
},
"type": "<string>"
}
]
}
],
"reward": 0,
"initial_policy_version": 123,
"final_policy_version": 123,
"metrics": {},
"metadata": {},
"logs": [
"<string>"
],
"start_time": "2023-11-07T05:31:56Z"
}
],
"exceptions": [
{
"type": "<string>",
"message": "<string>",
"traceback": "<string>"
}
],
"metadata": {},
"metrics": {},
"logs": [
"<string>"
]
}
],
"experimental_config": {
"advantage_balance": 123,
"allow_training_without_logprobs": true,
"epsilon": 123,
"epsilon_high": 123,
"kimi_k2_tau": 123,
"kl_penalty_coef": 123,
"kl_penalty_reference_step": 123,
"kl_penalty_step_lag": 123,
"kl_ref_adapter_path": "<string>",
"learning_rate": 123,
"logprob_calculation_chunk_size": 123,
"mask_prob_ratio": true,
"max_negative_advantage_importance_sampling_weight": 123,
"normalize_advantages": true,
"num_trajectories_learning_rate_multiplier_power": 123,
"packed_sequence_length": 123,
"plot_tensors": true,
"ppo": true,
"precalculate_logprobs": true,
"scale_learning_rate_by_reward_std_dev": true,
"scale_rewards": true,
"truncated_importance_sampling": 123
}
}
'import requests
url = "https://api.training.wandb.ai/v1/preview/training-jobs"
payload = {
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trajectory_groups": [
{
"trajectories": [
{
"exchanges": {
"chat_completions": [
{
"request": {
"model": "<string>",
"messages": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"stream": True,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
},
"type": "<string>"
}
],
"max_completion_tokens": 123,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": True,
"top_logprobs": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"annotations": [
{
"type": "<string>",
"url_citation": {
"end_index": 123,
"start_index": 123,
"title": "<string>",
"url": "<string>"
}
}
],
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"function_call": {
"arguments": "<string>",
"name": "<string>"
},
"tool_calls": [
{
"id": "<string>",
"function": {
"arguments": "<string>",
"name": "<string>"
},
"type": "<string>"
}
]
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [123]
}
],
"bytes": [123]
}
],
"refusal": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [123]
}
],
"bytes": [123]
}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"completions": [
{
"request": {
"model": "<string>",
"prompt": "<string>",
"stream": True,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": 123,
"echo": True,
"stop": "<string>",
"seed": 123
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"text": "<string>",
"logprobs": {
"text_offset": [123],
"token_logprobs": [123],
"tokens": ["<string>"],
"top_logprobs": [{}]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"responses": [
{
"request": {
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": True,
"tools": [
{
"name": "<string>",
"parameters": {},
"strict": True,
"type": "<string>",
"description": "<string>"
}
],
"max_output_tokens": 123,
"temperature": 123,
"top_p": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"created_at": 123,
"model": "<string>",
"object": "<string>",
"output": [
{
"id": "<string>",
"content": [
{
"annotations": [
{
"file_id": "<string>",
"filename": "<string>",
"index": 123,
"type": "<string>"
}
],
"text": "<string>",
"type": "<string>",
"logprobs": [
{
"token": "<string>",
"bytes": [123],
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"bytes": [123],
"logprob": 123
}
]
}
]
}
],
"role": "<string>",
"type": "<string>"
}
],
"parallel_tool_calls": True,
"tools": [
{
"name": "<string>",
"type": "<string>",
"parameters": {},
"strict": True,
"description": "<string>"
}
],
"error": { "message": "<string>" },
"incomplete_details": {},
"instructions": "<string>",
"metadata": {},
"temperature": 123,
"top_p": 123,
"background": True,
"conversation": { "id": "<string>" },
"max_output_tokens": 123,
"max_tool_calls": 123,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"text": { "format": { "type": "<string>" } },
"top_logprobs": 123,
"usage": {
"input_tokens": 123,
"input_tokens_details": { "cached_tokens": 123 },
"output_tokens": 123,
"output_tokens_details": { "reasoning_tokens": 123 },
"total_tokens": 123
},
"user": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"messages": [
{
"request": {
"model": "<string>",
"messages": [{ "content": "<string>" }],
"max_tokens": 123,
"stream": True,
"system": "<string>",
"tools": [
{
"input_schema": {
"type": "<string>",
"properties": {},
"required": ["<string>"]
},
"name": "<string>",
"allowed_callers": [],
"cache_control": { "type": "<string>" },
"defer_loading": True,
"description": "<string>",
"eager_input_streaming": True,
"input_examples": [{}],
"strict": True,
"type": "<string>"
}
],
"thinking": {
"budget_tokens": 123,
"type": "<string>"
},
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stop_sequences": ["<string>"],
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"content": [
{
"text": "<string>",
"type": "<string>",
"citations": [
{
"cited_text": "<string>",
"document_index": 123,
"end_char_index": 123,
"start_char_index": 123,
"type": "<string>",
"document_title": "<string>",
"file_id": "<string>"
}
]
}
],
"role": "<string>",
"type": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"inference_geo": "<string>",
"output_tokens_details": { "thinking_tokens": 123 },
"server_tool_use": {
"web_fetch_requests": 123,
"web_search_requests": 123
}
},
"container": {
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"stop_details": {
"type": "<string>",
"explanation": "<string>"
},
"stop_sequence": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
]
},
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
},
"type": "<string>"
}
],
"additional_histories": [
{
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
},
"type": "<string>"
}
]
}
],
"reward": 0,
"initial_policy_version": 123,
"final_policy_version": 123,
"metrics": {},
"metadata": {},
"logs": ["<string>"],
"start_time": "2023-11-07T05:31:56Z"
}
],
"exceptions": [
{
"type": "<string>",
"message": "<string>",
"traceback": "<string>"
}
],
"metadata": {},
"metrics": {},
"logs": ["<string>"]
}
],
"experimental_config": {
"advantage_balance": 123,
"allow_training_without_logprobs": True,
"epsilon": 123,
"epsilon_high": 123,
"kimi_k2_tau": 123,
"kl_penalty_coef": 123,
"kl_penalty_reference_step": 123,
"kl_penalty_step_lag": 123,
"kl_ref_adapter_path": "<string>",
"learning_rate": 123,
"logprob_calculation_chunk_size": 123,
"mask_prob_ratio": True,
"max_negative_advantage_importance_sampling_weight": 123,
"normalize_advantages": True,
"num_trajectories_learning_rate_multiplier_power": 123,
"packed_sequence_length": 123,
"plot_tensors": True,
"ppo": True,
"precalculate_logprobs": True,
"scale_learning_rate_by_reward_std_dev": True,
"scale_rewards": True,
"truncated_importance_sampling": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
trajectory_groups: [
{
trajectories: [
{
exchanges: {
chat_completions: [
{
request: {
model: '<string>',
messages: [{content: '<string>', role: '<string>', name: '<string>'}],
stream: true,
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}, strict: true},
type: '<string>'
}
],
max_completion_tokens: 123,
max_tokens: 123,
temperature: 123,
top_p: 123,
logprobs: true,
top_logprobs: 123,
chat_template: '<string>',
chat_template_kwargs: {}
},
response: {
id: '<string>',
choices: [
{
index: 123,
message: {
role: '<string>',
content: '<string>',
refusal: '<string>',
annotations: [
{
type: '<string>',
url_citation: {end_index: 123, start_index: 123, title: '<string>', url: '<string>'}
}
],
audio: {id: '<string>', data: '<string>', expires_at: 123, transcript: '<string>'},
function_call: {arguments: '<string>', name: '<string>'},
tool_calls: [
{
id: '<string>',
function: {arguments: '<string>', name: '<string>'},
type: '<string>'
}
]
},
logprobs: {
content: [
{
token: '<string>',
logprob: 123,
top_logprobs: [{token: '<string>', logprob: 123, bytes: [123]}],
bytes: [123]
}
],
refusal: [
{
token: '<string>',
logprob: 123,
top_logprobs: [{token: '<string>', logprob: 123, bytes: [123]}],
bytes: [123]
}
]
}
}
],
created: 123,
model: '<string>',
object: '<string>',
system_fingerprint: '<string>',
usage: {
completion_tokens: 123,
prompt_tokens: 123,
total_tokens: 123,
completion_tokens_details: {
accepted_prediction_tokens: 123,
audio_tokens: 123,
reasoning_tokens: 123,
rejected_prediction_tokens: 123
},
prompt_tokens_details: {audio_tokens: 123, cached_tokens: 123}
}
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
],
completions: [
{
request: {
model: '<string>',
prompt: '<string>',
stream: true,
max_tokens: 123,
temperature: 123,
top_p: 123,
logprobs: 123,
echo: true,
stop: '<string>',
seed: 123
},
response: {
id: '<string>',
choices: [
{
index: 123,
text: '<string>',
logprobs: {
text_offset: [123],
token_logprobs: [123],
tokens: ['<string>'],
top_logprobs: [{}]
}
}
],
created: 123,
model: '<string>',
object: '<string>',
system_fingerprint: '<string>',
usage: {
completion_tokens: 123,
prompt_tokens: 123,
total_tokens: 123,
completion_tokens_details: {
accepted_prediction_tokens: 123,
audio_tokens: 123,
reasoning_tokens: 123,
rejected_prediction_tokens: 123
},
prompt_tokens_details: {audio_tokens: 123, cached_tokens: 123}
}
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
],
responses: [
{
request: {
model: '<string>',
input: '<string>',
instructions: '<string>',
previous_response_id: '<string>',
stream: true,
tools: [
{
name: '<string>',
parameters: {},
strict: true,
type: '<string>',
description: '<string>'
}
],
max_output_tokens: 123,
temperature: 123,
top_p: 123,
chat_template: '<string>',
chat_template_kwargs: {}
},
response: {
id: '<string>',
created_at: 123,
model: '<string>',
object: '<string>',
output: [
{
id: '<string>',
content: [
{
annotations: [{file_id: '<string>', filename: '<string>', index: 123, type: '<string>'}],
text: '<string>',
type: '<string>',
logprobs: [
{
token: '<string>',
bytes: [123],
logprob: 123,
top_logprobs: [{token: '<string>', bytes: [123], logprob: 123}]
}
]
}
],
role: '<string>',
type: '<string>'
}
],
parallel_tool_calls: true,
tools: [
{
name: '<string>',
type: '<string>',
parameters: {},
strict: true,
description: '<string>'
}
],
error: {message: '<string>'},
incomplete_details: {},
instructions: '<string>',
metadata: {},
temperature: 123,
top_p: 123,
background: true,
conversation: {id: '<string>'},
max_output_tokens: 123,
max_tool_calls: 123,
previous_response_id: '<string>',
prompt: {id: '<string>', variables: {}, version: '<string>'},
prompt_cache_key: '<string>',
reasoning: {},
safety_identifier: '<string>',
text: {format: {type: '<string>'}},
top_logprobs: 123,
usage: {
input_tokens: 123,
input_tokens_details: {cached_tokens: 123},
output_tokens: 123,
output_tokens_details: {reasoning_tokens: 123},
total_tokens: 123
},
user: '<string>'
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
],
messages: [
{
request: {
model: '<string>',
messages: [{content: '<string>'}],
max_tokens: 123,
stream: true,
system: '<string>',
tools: [
{
input_schema: {type: '<string>', properties: {}, required: ['<string>']},
name: '<string>',
allowed_callers: [],
cache_control: {type: '<string>'},
defer_loading: true,
description: '<string>',
eager_input_streaming: true,
input_examples: [{}],
strict: true,
type: '<string>'
}
],
thinking: {budget_tokens: 123, type: '<string>'},
temperature: 123,
top_p: 123,
top_k: 123,
stop_sequences: ['<string>'],
chat_template: '<string>',
chat_template_kwargs: {}
},
response: {
id: '<string>',
content: [
{
text: '<string>',
type: '<string>',
citations: [
{
cited_text: '<string>',
document_index: 123,
end_char_index: 123,
start_char_index: 123,
type: '<string>',
document_title: '<string>',
file_id: '<string>'
}
]
}
],
role: '<string>',
type: '<string>',
usage: {
input_tokens: 123,
output_tokens: 123,
cache_creation: {ephemeral_1h_input_tokens: 123, ephemeral_5m_input_tokens: 123},
cache_creation_input_tokens: 123,
cache_read_input_tokens: 123,
inference_geo: '<string>',
output_tokens_details: {thinking_tokens: 123},
server_tool_use: {web_fetch_requests: 123, web_search_requests: 123}
},
container: {id: '<string>', expires_at: '2023-11-07T05:31:56Z'},
stop_details: {type: '<string>', explanation: '<string>'},
stop_sequence: '<string>'
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
]
},
messages_and_choices: [{content: '<string>', role: '<string>', name: '<string>'}],
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}, strict: true},
type: '<string>'
}
],
additional_histories: [
{
messages_and_choices: [{content: '<string>', role: '<string>', name: '<string>'}],
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}, strict: true},
type: '<string>'
}
]
}
],
reward: 0,
initial_policy_version: 123,
final_policy_version: 123,
metrics: {},
metadata: {},
logs: ['<string>'],
start_time: '2023-11-07T05:31:56Z'
}
],
exceptions: [{type: '<string>', message: '<string>', traceback: '<string>'}],
metadata: {},
metrics: {},
logs: ['<string>']
}
],
experimental_config: {
advantage_balance: 123,
allow_training_without_logprobs: true,
epsilon: 123,
epsilon_high: 123,
kimi_k2_tau: 123,
kl_penalty_coef: 123,
kl_penalty_reference_step: 123,
kl_penalty_step_lag: 123,
kl_ref_adapter_path: '<string>',
learning_rate: 123,
logprob_calculation_chunk_size: 123,
mask_prob_ratio: true,
max_negative_advantage_importance_sampling_weight: 123,
normalize_advantages: true,
num_trajectories_learning_rate_multiplier_power: 123,
packed_sequence_length: 123,
plot_tensors: true,
ppo: true,
precalculate_logprobs: true,
scale_learning_rate_by_reward_std_dev: true,
scale_rewards: true,
truncated_importance_sampling: 123
}
})
};
fetch('https://api.training.wandb.ai/v1/preview/training-jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.training.wandb.ai/v1/preview/training-jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'trajectory_groups' => [
[
'trajectories' => [
[
'exchanges' => [
'chat_completions' => [
[
'request' => [
'model' => '<string>',
'messages' => [
[
'content' => '<string>',
'role' => '<string>',
'name' => '<string>'
]
],
'stream' => true,
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
],
'type' => '<string>'
]
],
'max_completion_tokens' => 123,
'max_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'logprobs' => true,
'top_logprobs' => 123,
'chat_template' => '<string>',
'chat_template_kwargs' => [
]
],
'response' => [
'id' => '<string>',
'choices' => [
[
'index' => 123,
'message' => [
'role' => '<string>',
'content' => '<string>',
'refusal' => '<string>',
'annotations' => [
[
'type' => '<string>',
'url_citation' => [
'end_index' => 123,
'start_index' => 123,
'title' => '<string>',
'url' => '<string>'
]
]
],
'audio' => [
'id' => '<string>',
'data' => '<string>',
'expires_at' => 123,
'transcript' => '<string>'
],
'function_call' => [
'arguments' => '<string>',
'name' => '<string>'
],
'tool_calls' => [
[
'id' => '<string>',
'function' => [
'arguments' => '<string>',
'name' => '<string>'
],
'type' => '<string>'
]
]
],
'logprobs' => [
'content' => [
[
'token' => '<string>',
'logprob' => 123,
'top_logprobs' => [
[
'token' => '<string>',
'logprob' => 123,
'bytes' => [
123
]
]
],
'bytes' => [
123
]
]
],
'refusal' => [
[
'token' => '<string>',
'logprob' => 123,
'top_logprobs' => [
[
'token' => '<string>',
'logprob' => 123,
'bytes' => [
123
]
]
],
'bytes' => [
123
]
]
]
]
]
],
'created' => 123,
'model' => '<string>',
'object' => '<string>',
'system_fingerprint' => '<string>',
'usage' => [
'completion_tokens' => 123,
'prompt_tokens' => 123,
'total_tokens' => 123,
'completion_tokens_details' => [
'accepted_prediction_tokens' => 123,
'audio_tokens' => 123,
'reasoning_tokens' => 123,
'rejected_prediction_tokens' => 123
],
'prompt_tokens_details' => [
'audio_tokens' => 123,
'cached_tokens' => 123
]
]
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
],
'completions' => [
[
'request' => [
'model' => '<string>',
'prompt' => '<string>',
'stream' => true,
'max_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'logprobs' => 123,
'echo' => true,
'stop' => '<string>',
'seed' => 123
],
'response' => [
'id' => '<string>',
'choices' => [
[
'index' => 123,
'text' => '<string>',
'logprobs' => [
'text_offset' => [
123
],
'token_logprobs' => [
123
],
'tokens' => [
'<string>'
],
'top_logprobs' => [
[
]
]
]
]
],
'created' => 123,
'model' => '<string>',
'object' => '<string>',
'system_fingerprint' => '<string>',
'usage' => [
'completion_tokens' => 123,
'prompt_tokens' => 123,
'total_tokens' => 123,
'completion_tokens_details' => [
'accepted_prediction_tokens' => 123,
'audio_tokens' => 123,
'reasoning_tokens' => 123,
'rejected_prediction_tokens' => 123
],
'prompt_tokens_details' => [
'audio_tokens' => 123,
'cached_tokens' => 123
]
]
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
],
'responses' => [
[
'request' => [
'model' => '<string>',
'input' => '<string>',
'instructions' => '<string>',
'previous_response_id' => '<string>',
'stream' => true,
'tools' => [
[
'name' => '<string>',
'parameters' => [
],
'strict' => true,
'type' => '<string>',
'description' => '<string>'
]
],
'max_output_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'chat_template' => '<string>',
'chat_template_kwargs' => [
]
],
'response' => [
'id' => '<string>',
'created_at' => 123,
'model' => '<string>',
'object' => '<string>',
'output' => [
[
'id' => '<string>',
'content' => [
[
'annotations' => [
[
'file_id' => '<string>',
'filename' => '<string>',
'index' => 123,
'type' => '<string>'
]
],
'text' => '<string>',
'type' => '<string>',
'logprobs' => [
[
'token' => '<string>',
'bytes' => [
123
],
'logprob' => 123,
'top_logprobs' => [
[
'token' => '<string>',
'bytes' => [
123
],
'logprob' => 123
]
]
]
]
]
],
'role' => '<string>',
'type' => '<string>'
]
],
'parallel_tool_calls' => true,
'tools' => [
[
'name' => '<string>',
'type' => '<string>',
'parameters' => [
],
'strict' => true,
'description' => '<string>'
]
],
'error' => [
'message' => '<string>'
],
'incomplete_details' => [
],
'instructions' => '<string>',
'metadata' => [
],
'temperature' => 123,
'top_p' => 123,
'background' => true,
'conversation' => [
'id' => '<string>'
],
'max_output_tokens' => 123,
'max_tool_calls' => 123,
'previous_response_id' => '<string>',
'prompt' => [
'id' => '<string>',
'variables' => [
],
'version' => '<string>'
],
'prompt_cache_key' => '<string>',
'reasoning' => [
],
'safety_identifier' => '<string>',
'text' => [
'format' => [
'type' => '<string>'
]
],
'top_logprobs' => 123,
'usage' => [
'input_tokens' => 123,
'input_tokens_details' => [
'cached_tokens' => 123
],
'output_tokens' => 123,
'output_tokens_details' => [
'reasoning_tokens' => 123
],
'total_tokens' => 123
],
'user' => '<string>'
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
],
'messages' => [
[
'request' => [
'model' => '<string>',
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 123,
'stream' => true,
'system' => '<string>',
'tools' => [
[
'input_schema' => [
'type' => '<string>',
'properties' => [
],
'required' => [
'<string>'
]
],
'name' => '<string>',
'allowed_callers' => [
],
'cache_control' => [
'type' => '<string>'
],
'defer_loading' => true,
'description' => '<string>',
'eager_input_streaming' => true,
'input_examples' => [
[
]
],
'strict' => true,
'type' => '<string>'
]
],
'thinking' => [
'budget_tokens' => 123,
'type' => '<string>'
],
'temperature' => 123,
'top_p' => 123,
'top_k' => 123,
'stop_sequences' => [
'<string>'
],
'chat_template' => '<string>',
'chat_template_kwargs' => [
]
],
'response' => [
'id' => '<string>',
'content' => [
[
'text' => '<string>',
'type' => '<string>',
'citations' => [
[
'cited_text' => '<string>',
'document_index' => 123,
'end_char_index' => 123,
'start_char_index' => 123,
'type' => '<string>',
'document_title' => '<string>',
'file_id' => '<string>'
]
]
]
],
'role' => '<string>',
'type' => '<string>',
'usage' => [
'input_tokens' => 123,
'output_tokens' => 123,
'cache_creation' => [
'ephemeral_1h_input_tokens' => 123,
'ephemeral_5m_input_tokens' => 123
],
'cache_creation_input_tokens' => 123,
'cache_read_input_tokens' => 123,
'inference_geo' => '<string>',
'output_tokens_details' => [
'thinking_tokens' => 123
],
'server_tool_use' => [
'web_fetch_requests' => 123,
'web_search_requests' => 123
]
],
'container' => [
'id' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
],
'stop_details' => [
'type' => '<string>',
'explanation' => '<string>'
],
'stop_sequence' => '<string>'
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
]
],
'messages_and_choices' => [
[
'content' => '<string>',
'role' => '<string>',
'name' => '<string>'
]
],
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
],
'type' => '<string>'
]
],
'additional_histories' => [
[
'messages_and_choices' => [
[
'content' => '<string>',
'role' => '<string>',
'name' => '<string>'
]
],
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
],
'type' => '<string>'
]
]
]
],
'reward' => 0,
'initial_policy_version' => 123,
'final_policy_version' => 123,
'metrics' => [
],
'metadata' => [
],
'logs' => [
'<string>'
],
'start_time' => '2023-11-07T05:31:56Z'
]
],
'exceptions' => [
[
'type' => '<string>',
'message' => '<string>',
'traceback' => '<string>'
]
],
'metadata' => [
],
'metrics' => [
],
'logs' => [
'<string>'
]
]
],
'experimental_config' => [
'advantage_balance' => 123,
'allow_training_without_logprobs' => true,
'epsilon' => 123,
'epsilon_high' => 123,
'kimi_k2_tau' => 123,
'kl_penalty_coef' => 123,
'kl_penalty_reference_step' => 123,
'kl_penalty_step_lag' => 123,
'kl_ref_adapter_path' => '<string>',
'learning_rate' => 123,
'logprob_calculation_chunk_size' => 123,
'mask_prob_ratio' => true,
'max_negative_advantage_importance_sampling_weight' => 123,
'normalize_advantages' => true,
'num_trajectories_learning_rate_multiplier_power' => 123,
'packed_sequence_length' => 123,
'plot_tensors' => true,
'ppo' => true,
'precalculate_logprobs' => true,
'scale_learning_rate_by_reward_std_dev' => true,
'scale_rewards' => true,
'truncated_importance_sampling' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.training.wandb.ai/v1/preview/training-jobs"
payload := strings.NewReader("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"trajectory_groups\": [\n {\n \"trajectories\": [\n {\n \"exchanges\": {\n \"chat_completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"max_completion_tokens\": 123,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"message\": {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"refusal\": \"<string>\",\n \"annotations\": [\n {\n \"type\": \"<string>\",\n \"url_citation\": {\n \"end_index\": 123,\n \"start_index\": 123,\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n }\n ],\n \"audio\": {\n \"id\": \"<string>\",\n \"data\": \"<string>\",\n \"expires_at\": 123,\n \"transcript\": \"<string>\"\n },\n \"function_call\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n }\n ]\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ],\n \"refusal\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"stream\": true,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": 123,\n \"echo\": true,\n \"stop\": \"<string>\",\n \"seed\": 123\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"text\": \"<string>\",\n \"logprobs\": {\n \"text_offset\": [\n 123\n ],\n \"token_logprobs\": [\n 123\n ],\n \"tokens\": [\n \"<string>\"\n ],\n \"top_logprobs\": [\n {}\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"responses\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"max_output_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"created_at\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"output\": [\n {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"annotations\": [\n {\n \"file_id\": \"<string>\",\n \"filename\": \"<string>\",\n \"index\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123\n }\n ]\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"error\": {\n \"message\": \"<string>\"\n },\n \"incomplete_details\": {},\n \"instructions\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"background\": true,\n \"conversation\": {\n \"id\": \"<string>\"\n },\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"<string>\"\n }\n },\n \"top_logprobs\": 123,\n \"usage\": {\n \"input_tokens\": 123,\n \"input_tokens_details\": {\n \"cached_tokens\": 123\n },\n \"output_tokens\": 123,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 123\n },\n \"total_tokens\": 123\n },\n \"user\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"messages\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": true,\n \"system\": \"<string>\",\n \"tools\": [\n {\n \"input_schema\": {\n \"type\": \"<string>\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"allowed_callers\": [],\n \"cache_control\": {\n \"type\": \"<string>\"\n },\n \"defer_loading\": true,\n \"description\": \"<string>\",\n \"eager_input_streaming\": true,\n \"input_examples\": [\n {}\n ],\n \"strict\": true,\n \"type\": \"<string>\"\n }\n ],\n \"thinking\": {\n \"budget_tokens\": 123,\n \"type\": \"<string>\"\n },\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"citations\": [\n {\n \"cited_text\": \"<string>\",\n \"document_index\": 123,\n \"end_char_index\": 123,\n \"start_char_index\": 123,\n \"type\": \"<string>\",\n \"document_title\": \"<string>\",\n \"file_id\": \"<string>\"\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\",\n \"usage\": {\n \"input_tokens\": 123,\n \"output_tokens\": 123,\n \"cache_creation\": {\n \"ephemeral_1h_input_tokens\": 123,\n \"ephemeral_5m_input_tokens\": 123\n },\n \"cache_creation_input_tokens\": 123,\n \"cache_read_input_tokens\": 123,\n \"inference_geo\": \"<string>\",\n \"output_tokens_details\": {\n \"thinking_tokens\": 123\n },\n \"server_tool_use\": {\n \"web_fetch_requests\": 123,\n \"web_search_requests\": 123\n }\n },\n \"container\": {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n },\n \"stop_details\": {\n \"type\": \"<string>\",\n \"explanation\": \"<string>\"\n },\n \"stop_sequence\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"additional_histories\": [\n {\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ]\n }\n ],\n \"reward\": 0,\n \"initial_policy_version\": 123,\n \"final_policy_version\": 123,\n \"metrics\": {},\n \"metadata\": {},\n \"logs\": [\n \"<string>\"\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"exceptions\": [\n {\n \"type\": \"<string>\",\n \"message\": \"<string>\",\n \"traceback\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"metrics\": {},\n \"logs\": [\n \"<string>\"\n ]\n }\n ],\n \"experimental_config\": {\n \"advantage_balance\": 123,\n \"allow_training_without_logprobs\": true,\n \"epsilon\": 123,\n \"epsilon_high\": 123,\n \"kimi_k2_tau\": 123,\n \"kl_penalty_coef\": 123,\n \"kl_penalty_reference_step\": 123,\n \"kl_penalty_step_lag\": 123,\n \"kl_ref_adapter_path\": \"<string>\",\n \"learning_rate\": 123,\n \"logprob_calculation_chunk_size\": 123,\n \"mask_prob_ratio\": true,\n \"max_negative_advantage_importance_sampling_weight\": 123,\n \"normalize_advantages\": true,\n \"num_trajectories_learning_rate_multiplier_power\": 123,\n \"packed_sequence_length\": 123,\n \"plot_tensors\": true,\n \"ppo\": true,\n \"precalculate_logprobs\": true,\n \"scale_learning_rate_by_reward_std_dev\": true,\n \"scale_rewards\": true,\n \"truncated_importance_sampling\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.training.wandb.ai/v1/preview/training-jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"trajectory_groups\": [\n {\n \"trajectories\": [\n {\n \"exchanges\": {\n \"chat_completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"max_completion_tokens\": 123,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"message\": {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"refusal\": \"<string>\",\n \"annotations\": [\n {\n \"type\": \"<string>\",\n \"url_citation\": {\n \"end_index\": 123,\n \"start_index\": 123,\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n }\n ],\n \"audio\": {\n \"id\": \"<string>\",\n \"data\": \"<string>\",\n \"expires_at\": 123,\n \"transcript\": \"<string>\"\n },\n \"function_call\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n }\n ]\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ],\n \"refusal\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"stream\": true,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": 123,\n \"echo\": true,\n \"stop\": \"<string>\",\n \"seed\": 123\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"text\": \"<string>\",\n \"logprobs\": {\n \"text_offset\": [\n 123\n ],\n \"token_logprobs\": [\n 123\n ],\n \"tokens\": [\n \"<string>\"\n ],\n \"top_logprobs\": [\n {}\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"responses\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"max_output_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"created_at\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"output\": [\n {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"annotations\": [\n {\n \"file_id\": \"<string>\",\n \"filename\": \"<string>\",\n \"index\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123\n }\n ]\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"error\": {\n \"message\": \"<string>\"\n },\n \"incomplete_details\": {},\n \"instructions\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"background\": true,\n \"conversation\": {\n \"id\": \"<string>\"\n },\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"<string>\"\n }\n },\n \"top_logprobs\": 123,\n \"usage\": {\n \"input_tokens\": 123,\n \"input_tokens_details\": {\n \"cached_tokens\": 123\n },\n \"output_tokens\": 123,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 123\n },\n \"total_tokens\": 123\n },\n \"user\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"messages\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": true,\n \"system\": \"<string>\",\n \"tools\": [\n {\n \"input_schema\": {\n \"type\": \"<string>\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"allowed_callers\": [],\n \"cache_control\": {\n \"type\": \"<string>\"\n },\n \"defer_loading\": true,\n \"description\": \"<string>\",\n \"eager_input_streaming\": true,\n \"input_examples\": [\n {}\n ],\n \"strict\": true,\n \"type\": \"<string>\"\n }\n ],\n \"thinking\": {\n \"budget_tokens\": 123,\n \"type\": \"<string>\"\n },\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"citations\": [\n {\n \"cited_text\": \"<string>\",\n \"document_index\": 123,\n \"end_char_index\": 123,\n \"start_char_index\": 123,\n \"type\": \"<string>\",\n \"document_title\": \"<string>\",\n \"file_id\": \"<string>\"\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\",\n \"usage\": {\n \"input_tokens\": 123,\n \"output_tokens\": 123,\n \"cache_creation\": {\n \"ephemeral_1h_input_tokens\": 123,\n \"ephemeral_5m_input_tokens\": 123\n },\n \"cache_creation_input_tokens\": 123,\n \"cache_read_input_tokens\": 123,\n \"inference_geo\": \"<string>\",\n \"output_tokens_details\": {\n \"thinking_tokens\": 123\n },\n \"server_tool_use\": {\n \"web_fetch_requests\": 123,\n \"web_search_requests\": 123\n }\n },\n \"container\": {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n },\n \"stop_details\": {\n \"type\": \"<string>\",\n \"explanation\": \"<string>\"\n },\n \"stop_sequence\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"additional_histories\": [\n {\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ]\n }\n ],\n \"reward\": 0,\n \"initial_policy_version\": 123,\n \"final_policy_version\": 123,\n \"metrics\": {},\n \"metadata\": {},\n \"logs\": [\n \"<string>\"\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"exceptions\": [\n {\n \"type\": \"<string>\",\n \"message\": \"<string>\",\n \"traceback\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"metrics\": {},\n \"logs\": [\n \"<string>\"\n ]\n }\n ],\n \"experimental_config\": {\n \"advantage_balance\": 123,\n \"allow_training_without_logprobs\": true,\n \"epsilon\": 123,\n \"epsilon_high\": 123,\n \"kimi_k2_tau\": 123,\n \"kl_penalty_coef\": 123,\n \"kl_penalty_reference_step\": 123,\n \"kl_penalty_step_lag\": 123,\n \"kl_ref_adapter_path\": \"<string>\",\n \"learning_rate\": 123,\n \"logprob_calculation_chunk_size\": 123,\n \"mask_prob_ratio\": true,\n \"max_negative_advantage_importance_sampling_weight\": 123,\n \"normalize_advantages\": true,\n \"num_trajectories_learning_rate_multiplier_power\": 123,\n \"packed_sequence_length\": 123,\n \"plot_tensors\": true,\n \"ppo\": true,\n \"precalculate_logprobs\": true,\n \"scale_learning_rate_by_reward_std_dev\": true,\n \"scale_rewards\": true,\n \"truncated_importance_sampling\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.training.wandb.ai/v1/preview/training-jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"trajectory_groups\": [\n {\n \"trajectories\": [\n {\n \"exchanges\": {\n \"chat_completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"max_completion_tokens\": 123,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"message\": {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"refusal\": \"<string>\",\n \"annotations\": [\n {\n \"type\": \"<string>\",\n \"url_citation\": {\n \"end_index\": 123,\n \"start_index\": 123,\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n }\n ],\n \"audio\": {\n \"id\": \"<string>\",\n \"data\": \"<string>\",\n \"expires_at\": 123,\n \"transcript\": \"<string>\"\n },\n \"function_call\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n }\n ]\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ],\n \"refusal\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"stream\": true,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": 123,\n \"echo\": true,\n \"stop\": \"<string>\",\n \"seed\": 123\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"text\": \"<string>\",\n \"logprobs\": {\n \"text_offset\": [\n 123\n ],\n \"token_logprobs\": [\n 123\n ],\n \"tokens\": [\n \"<string>\"\n ],\n \"top_logprobs\": [\n {}\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"responses\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"max_output_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"created_at\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"output\": [\n {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"annotations\": [\n {\n \"file_id\": \"<string>\",\n \"filename\": \"<string>\",\n \"index\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123\n }\n ]\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"error\": {\n \"message\": \"<string>\"\n },\n \"incomplete_details\": {},\n \"instructions\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"background\": true,\n \"conversation\": {\n \"id\": \"<string>\"\n },\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"<string>\"\n }\n },\n \"top_logprobs\": 123,\n \"usage\": {\n \"input_tokens\": 123,\n \"input_tokens_details\": {\n \"cached_tokens\": 123\n },\n \"output_tokens\": 123,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 123\n },\n \"total_tokens\": 123\n },\n \"user\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"messages\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": true,\n \"system\": \"<string>\",\n \"tools\": [\n {\n \"input_schema\": {\n \"type\": \"<string>\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"allowed_callers\": [],\n \"cache_control\": {\n \"type\": \"<string>\"\n },\n \"defer_loading\": true,\n \"description\": \"<string>\",\n \"eager_input_streaming\": true,\n \"input_examples\": [\n {}\n ],\n \"strict\": true,\n \"type\": \"<string>\"\n }\n ],\n \"thinking\": {\n \"budget_tokens\": 123,\n \"type\": \"<string>\"\n },\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"citations\": [\n {\n \"cited_text\": \"<string>\",\n \"document_index\": 123,\n \"end_char_index\": 123,\n \"start_char_index\": 123,\n \"type\": \"<string>\",\n \"document_title\": \"<string>\",\n \"file_id\": \"<string>\"\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\",\n \"usage\": {\n \"input_tokens\": 123,\n \"output_tokens\": 123,\n \"cache_creation\": {\n \"ephemeral_1h_input_tokens\": 123,\n \"ephemeral_5m_input_tokens\": 123\n },\n \"cache_creation_input_tokens\": 123,\n \"cache_read_input_tokens\": 123,\n \"inference_geo\": \"<string>\",\n \"output_tokens_details\": {\n \"thinking_tokens\": 123\n },\n \"server_tool_use\": {\n \"web_fetch_requests\": 123,\n \"web_search_requests\": 123\n }\n },\n \"container\": {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n },\n \"stop_details\": {\n \"type\": \"<string>\",\n \"explanation\": \"<string>\"\n },\n \"stop_sequence\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"additional_histories\": [\n {\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ]\n }\n ],\n \"reward\": 0,\n \"initial_policy_version\": 123,\n \"final_policy_version\": 123,\n \"metrics\": {},\n \"metadata\": {},\n \"logs\": [\n \"<string>\"\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"exceptions\": [\n {\n \"type\": \"<string>\",\n \"message\": \"<string>\",\n \"traceback\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"metrics\": {},\n \"logs\": [\n \"<string>\"\n ]\n }\n ],\n \"experimental_config\": {\n \"advantage_balance\": 123,\n \"allow_training_without_logprobs\": true,\n \"epsilon\": 123,\n \"epsilon_high\": 123,\n \"kimi_k2_tau\": 123,\n \"kl_penalty_coef\": 123,\n \"kl_penalty_reference_step\": 123,\n \"kl_penalty_step_lag\": 123,\n \"kl_ref_adapter_path\": \"<string>\",\n \"learning_rate\": 123,\n \"logprob_calculation_chunk_size\": 123,\n \"mask_prob_ratio\": true,\n \"max_negative_advantage_importance_sampling_weight\": 123,\n \"normalize_advantages\": true,\n \"num_trajectories_learning_rate_multiplier_power\": 123,\n \"packed_sequence_length\": 123,\n \"plot_tensors\": true,\n \"ppo\": true,\n \"precalculate_logprobs\": true,\n \"scale_learning_rate_by_reward_std_dev\": true,\n \"scale_rewards\": true,\n \"truncated_importance_sampling\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Rl Training Job
Create a new RL (Reinforcement Learning) training job.
POST
/
v1
/
preview
/
training-jobs
Create Rl Training Job
curl --request POST \
--url https://api.training.wandb.ai/v1/preview/training-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trajectory_groups": [
{
"trajectories": [
{
"exchanges": {
"chat_completions": [
{
"request": {
"model": "<string>",
"messages": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"stream": true,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
},
"type": "<string>"
}
],
"max_completion_tokens": 123,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": true,
"top_logprobs": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"annotations": [
{
"type": "<string>",
"url_citation": {
"end_index": 123,
"start_index": 123,
"title": "<string>",
"url": "<string>"
}
}
],
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"function_call": {
"arguments": "<string>",
"name": "<string>"
},
"tool_calls": [
{
"id": "<string>",
"function": {
"arguments": "<string>",
"name": "<string>"
},
"type": "<string>"
}
]
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
],
"bytes": [
123
]
}
],
"refusal": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [
123
]
}
],
"bytes": [
123
]
}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"completions": [
{
"request": {
"model": "<string>",
"prompt": "<string>",
"stream": true,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": 123,
"echo": true,
"stop": "<string>",
"seed": 123
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"text": "<string>",
"logprobs": {
"text_offset": [
123
],
"token_logprobs": [
123
],
"tokens": [
"<string>"
],
"top_logprobs": [
{}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"responses": [
{
"request": {
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": true,
"tools": [
{
"name": "<string>",
"parameters": {},
"strict": true,
"type": "<string>",
"description": "<string>"
}
],
"max_output_tokens": 123,
"temperature": 123,
"top_p": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"created_at": 123,
"model": "<string>",
"object": "<string>",
"output": [
{
"id": "<string>",
"content": [
{
"annotations": [
{
"file_id": "<string>",
"filename": "<string>",
"index": 123,
"type": "<string>"
}
],
"text": "<string>",
"type": "<string>",
"logprobs": [
{
"token": "<string>",
"bytes": [
123
],
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"bytes": [
123
],
"logprob": 123
}
]
}
]
}
],
"role": "<string>",
"type": "<string>"
}
],
"parallel_tool_calls": true,
"tools": [
{
"name": "<string>",
"type": "<string>",
"parameters": {},
"strict": true,
"description": "<string>"
}
],
"error": {
"message": "<string>"
},
"incomplete_details": {},
"instructions": "<string>",
"metadata": {},
"temperature": 123,
"top_p": 123,
"background": true,
"conversation": {
"id": "<string>"
},
"max_output_tokens": 123,
"max_tool_calls": 123,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"text": {
"format": {
"type": "<string>"
}
},
"top_logprobs": 123,
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
},
"total_tokens": 123
},
"user": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"messages": [
{
"request": {
"model": "<string>",
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 123,
"stream": true,
"system": "<string>",
"tools": [
{
"input_schema": {
"type": "<string>",
"properties": {},
"required": [
"<string>"
]
},
"name": "<string>",
"allowed_callers": [],
"cache_control": {
"type": "<string>"
},
"defer_loading": true,
"description": "<string>",
"eager_input_streaming": true,
"input_examples": [
{}
],
"strict": true,
"type": "<string>"
}
],
"thinking": {
"budget_tokens": 123,
"type": "<string>"
},
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stop_sequences": [
"<string>"
],
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"content": [
{
"text": "<string>",
"type": "<string>",
"citations": [
{
"cited_text": "<string>",
"document_index": 123,
"end_char_index": 123,
"start_char_index": 123,
"type": "<string>",
"document_title": "<string>",
"file_id": "<string>"
}
]
}
],
"role": "<string>",
"type": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"inference_geo": "<string>",
"output_tokens_details": {
"thinking_tokens": 123
},
"server_tool_use": {
"web_fetch_requests": 123,
"web_search_requests": 123
}
},
"container": {
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"stop_details": {
"type": "<string>",
"explanation": "<string>"
},
"stop_sequence": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
]
},
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
},
"type": "<string>"
}
],
"additional_histories": [
{
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
},
"type": "<string>"
}
]
}
],
"reward": 0,
"initial_policy_version": 123,
"final_policy_version": 123,
"metrics": {},
"metadata": {},
"logs": [
"<string>"
],
"start_time": "2023-11-07T05:31:56Z"
}
],
"exceptions": [
{
"type": "<string>",
"message": "<string>",
"traceback": "<string>"
}
],
"metadata": {},
"metrics": {},
"logs": [
"<string>"
]
}
],
"experimental_config": {
"advantage_balance": 123,
"allow_training_without_logprobs": true,
"epsilon": 123,
"epsilon_high": 123,
"kimi_k2_tau": 123,
"kl_penalty_coef": 123,
"kl_penalty_reference_step": 123,
"kl_penalty_step_lag": 123,
"kl_ref_adapter_path": "<string>",
"learning_rate": 123,
"logprob_calculation_chunk_size": 123,
"mask_prob_ratio": true,
"max_negative_advantage_importance_sampling_weight": 123,
"normalize_advantages": true,
"num_trajectories_learning_rate_multiplier_power": 123,
"packed_sequence_length": 123,
"plot_tensors": true,
"ppo": true,
"precalculate_logprobs": true,
"scale_learning_rate_by_reward_std_dev": true,
"scale_rewards": true,
"truncated_importance_sampling": 123
}
}
'import requests
url = "https://api.training.wandb.ai/v1/preview/training-jobs"
payload = {
"model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trajectory_groups": [
{
"trajectories": [
{
"exchanges": {
"chat_completions": [
{
"request": {
"model": "<string>",
"messages": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"stream": True,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
},
"type": "<string>"
}
],
"max_completion_tokens": 123,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": True,
"top_logprobs": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"annotations": [
{
"type": "<string>",
"url_citation": {
"end_index": 123,
"start_index": 123,
"title": "<string>",
"url": "<string>"
}
}
],
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"function_call": {
"arguments": "<string>",
"name": "<string>"
},
"tool_calls": [
{
"id": "<string>",
"function": {
"arguments": "<string>",
"name": "<string>"
},
"type": "<string>"
}
]
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [123]
}
],
"bytes": [123]
}
],
"refusal": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"logprob": 123,
"bytes": [123]
}
],
"bytes": [123]
}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"completions": [
{
"request": {
"model": "<string>",
"prompt": "<string>",
"stream": True,
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"logprobs": 123,
"echo": True,
"stop": "<string>",
"seed": 123
},
"response": {
"id": "<string>",
"choices": [
{
"index": 123,
"text": "<string>",
"logprobs": {
"text_offset": [123],
"token_logprobs": [123],
"tokens": ["<string>"],
"top_logprobs": [{}]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"audio_tokens": 123,
"cached_tokens": 123
}
}
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"responses": [
{
"request": {
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": True,
"tools": [
{
"name": "<string>",
"parameters": {},
"strict": True,
"type": "<string>",
"description": "<string>"
}
],
"max_output_tokens": 123,
"temperature": 123,
"top_p": 123,
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"created_at": 123,
"model": "<string>",
"object": "<string>",
"output": [
{
"id": "<string>",
"content": [
{
"annotations": [
{
"file_id": "<string>",
"filename": "<string>",
"index": 123,
"type": "<string>"
}
],
"text": "<string>",
"type": "<string>",
"logprobs": [
{
"token": "<string>",
"bytes": [123],
"logprob": 123,
"top_logprobs": [
{
"token": "<string>",
"bytes": [123],
"logprob": 123
}
]
}
]
}
],
"role": "<string>",
"type": "<string>"
}
],
"parallel_tool_calls": True,
"tools": [
{
"name": "<string>",
"type": "<string>",
"parameters": {},
"strict": True,
"description": "<string>"
}
],
"error": { "message": "<string>" },
"incomplete_details": {},
"instructions": "<string>",
"metadata": {},
"temperature": 123,
"top_p": 123,
"background": True,
"conversation": { "id": "<string>" },
"max_output_tokens": 123,
"max_tool_calls": 123,
"previous_response_id": "<string>",
"prompt": {
"id": "<string>",
"variables": {},
"version": "<string>"
},
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"text": { "format": { "type": "<string>" } },
"top_logprobs": 123,
"usage": {
"input_tokens": 123,
"input_tokens_details": { "cached_tokens": 123 },
"output_tokens": 123,
"output_tokens_details": { "reasoning_tokens": 123 },
"total_tokens": 123
},
"user": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
],
"messages": [
{
"request": {
"model": "<string>",
"messages": [{ "content": "<string>" }],
"max_tokens": 123,
"stream": True,
"system": "<string>",
"tools": [
{
"input_schema": {
"type": "<string>",
"properties": {},
"required": ["<string>"]
},
"name": "<string>",
"allowed_callers": [],
"cache_control": { "type": "<string>" },
"defer_loading": True,
"description": "<string>",
"eager_input_streaming": True,
"input_examples": [{}],
"strict": True,
"type": "<string>"
}
],
"thinking": {
"budget_tokens": 123,
"type": "<string>"
},
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stop_sequences": ["<string>"],
"chat_template": "<string>",
"chat_template_kwargs": {}
},
"response": {
"id": "<string>",
"content": [
{
"text": "<string>",
"type": "<string>",
"citations": [
{
"cited_text": "<string>",
"document_index": 123,
"end_char_index": 123,
"start_char_index": 123,
"type": "<string>",
"document_title": "<string>",
"file_id": "<string>"
}
]
}
],
"role": "<string>",
"type": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"inference_geo": "<string>",
"output_tokens_details": { "thinking_tokens": 123 },
"server_tool_use": {
"web_fetch_requests": 123,
"web_search_requests": 123
}
},
"container": {
"id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"stop_details": {
"type": "<string>",
"explanation": "<string>"
},
"stop_sequence": "<string>"
},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
]
},
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
},
"type": "<string>"
}
],
"additional_histories": [
{
"messages_and_choices": [
{
"content": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
},
"type": "<string>"
}
]
}
],
"reward": 0,
"initial_policy_version": 123,
"final_policy_version": 123,
"metrics": {},
"metadata": {},
"logs": ["<string>"],
"start_time": "2023-11-07T05:31:56Z"
}
],
"exceptions": [
{
"type": "<string>",
"message": "<string>",
"traceback": "<string>"
}
],
"metadata": {},
"metrics": {},
"logs": ["<string>"]
}
],
"experimental_config": {
"advantage_balance": 123,
"allow_training_without_logprobs": True,
"epsilon": 123,
"epsilon_high": 123,
"kimi_k2_tau": 123,
"kl_penalty_coef": 123,
"kl_penalty_reference_step": 123,
"kl_penalty_step_lag": 123,
"kl_ref_adapter_path": "<string>",
"learning_rate": 123,
"logprob_calculation_chunk_size": 123,
"mask_prob_ratio": True,
"max_negative_advantage_importance_sampling_weight": 123,
"normalize_advantages": True,
"num_trajectories_learning_rate_multiplier_power": 123,
"packed_sequence_length": 123,
"plot_tensors": True,
"ppo": True,
"precalculate_logprobs": True,
"scale_learning_rate_by_reward_std_dev": True,
"scale_rewards": True,
"truncated_importance_sampling": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
trajectory_groups: [
{
trajectories: [
{
exchanges: {
chat_completions: [
{
request: {
model: '<string>',
messages: [{content: '<string>', role: '<string>', name: '<string>'}],
stream: true,
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}, strict: true},
type: '<string>'
}
],
max_completion_tokens: 123,
max_tokens: 123,
temperature: 123,
top_p: 123,
logprobs: true,
top_logprobs: 123,
chat_template: '<string>',
chat_template_kwargs: {}
},
response: {
id: '<string>',
choices: [
{
index: 123,
message: {
role: '<string>',
content: '<string>',
refusal: '<string>',
annotations: [
{
type: '<string>',
url_citation: {end_index: 123, start_index: 123, title: '<string>', url: '<string>'}
}
],
audio: {id: '<string>', data: '<string>', expires_at: 123, transcript: '<string>'},
function_call: {arguments: '<string>', name: '<string>'},
tool_calls: [
{
id: '<string>',
function: {arguments: '<string>', name: '<string>'},
type: '<string>'
}
]
},
logprobs: {
content: [
{
token: '<string>',
logprob: 123,
top_logprobs: [{token: '<string>', logprob: 123, bytes: [123]}],
bytes: [123]
}
],
refusal: [
{
token: '<string>',
logprob: 123,
top_logprobs: [{token: '<string>', logprob: 123, bytes: [123]}],
bytes: [123]
}
]
}
}
],
created: 123,
model: '<string>',
object: '<string>',
system_fingerprint: '<string>',
usage: {
completion_tokens: 123,
prompt_tokens: 123,
total_tokens: 123,
completion_tokens_details: {
accepted_prediction_tokens: 123,
audio_tokens: 123,
reasoning_tokens: 123,
rejected_prediction_tokens: 123
},
prompt_tokens_details: {audio_tokens: 123, cached_tokens: 123}
}
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
],
completions: [
{
request: {
model: '<string>',
prompt: '<string>',
stream: true,
max_tokens: 123,
temperature: 123,
top_p: 123,
logprobs: 123,
echo: true,
stop: '<string>',
seed: 123
},
response: {
id: '<string>',
choices: [
{
index: 123,
text: '<string>',
logprobs: {
text_offset: [123],
token_logprobs: [123],
tokens: ['<string>'],
top_logprobs: [{}]
}
}
],
created: 123,
model: '<string>',
object: '<string>',
system_fingerprint: '<string>',
usage: {
completion_tokens: 123,
prompt_tokens: 123,
total_tokens: 123,
completion_tokens_details: {
accepted_prediction_tokens: 123,
audio_tokens: 123,
reasoning_tokens: 123,
rejected_prediction_tokens: 123
},
prompt_tokens_details: {audio_tokens: 123, cached_tokens: 123}
}
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
],
responses: [
{
request: {
model: '<string>',
input: '<string>',
instructions: '<string>',
previous_response_id: '<string>',
stream: true,
tools: [
{
name: '<string>',
parameters: {},
strict: true,
type: '<string>',
description: '<string>'
}
],
max_output_tokens: 123,
temperature: 123,
top_p: 123,
chat_template: '<string>',
chat_template_kwargs: {}
},
response: {
id: '<string>',
created_at: 123,
model: '<string>',
object: '<string>',
output: [
{
id: '<string>',
content: [
{
annotations: [{file_id: '<string>', filename: '<string>', index: 123, type: '<string>'}],
text: '<string>',
type: '<string>',
logprobs: [
{
token: '<string>',
bytes: [123],
logprob: 123,
top_logprobs: [{token: '<string>', bytes: [123], logprob: 123}]
}
]
}
],
role: '<string>',
type: '<string>'
}
],
parallel_tool_calls: true,
tools: [
{
name: '<string>',
type: '<string>',
parameters: {},
strict: true,
description: '<string>'
}
],
error: {message: '<string>'},
incomplete_details: {},
instructions: '<string>',
metadata: {},
temperature: 123,
top_p: 123,
background: true,
conversation: {id: '<string>'},
max_output_tokens: 123,
max_tool_calls: 123,
previous_response_id: '<string>',
prompt: {id: '<string>', variables: {}, version: '<string>'},
prompt_cache_key: '<string>',
reasoning: {},
safety_identifier: '<string>',
text: {format: {type: '<string>'}},
top_logprobs: 123,
usage: {
input_tokens: 123,
input_tokens_details: {cached_tokens: 123},
output_tokens: 123,
output_tokens_details: {reasoning_tokens: 123},
total_tokens: 123
},
user: '<string>'
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
],
messages: [
{
request: {
model: '<string>',
messages: [{content: '<string>'}],
max_tokens: 123,
stream: true,
system: '<string>',
tools: [
{
input_schema: {type: '<string>', properties: {}, required: ['<string>']},
name: '<string>',
allowed_callers: [],
cache_control: {type: '<string>'},
defer_loading: true,
description: '<string>',
eager_input_streaming: true,
input_examples: [{}],
strict: true,
type: '<string>'
}
],
thinking: {budget_tokens: 123, type: '<string>'},
temperature: 123,
top_p: 123,
top_k: 123,
stop_sequences: ['<string>'],
chat_template: '<string>',
chat_template_kwargs: {}
},
response: {
id: '<string>',
content: [
{
text: '<string>',
type: '<string>',
citations: [
{
cited_text: '<string>',
document_index: 123,
end_char_index: 123,
start_char_index: 123,
type: '<string>',
document_title: '<string>',
file_id: '<string>'
}
]
}
],
role: '<string>',
type: '<string>',
usage: {
input_tokens: 123,
output_tokens: 123,
cache_creation: {ephemeral_1h_input_tokens: 123, ephemeral_5m_input_tokens: 123},
cache_creation_input_tokens: 123,
cache_read_input_tokens: 123,
inference_geo: '<string>',
output_tokens_details: {thinking_tokens: 123},
server_tool_use: {web_fetch_requests: 123, web_search_requests: 123}
},
container: {id: '<string>', expires_at: '2023-11-07T05:31:56Z'},
stop_details: {type: '<string>', explanation: '<string>'},
stop_sequence: '<string>'
},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z'
}
]
},
messages_and_choices: [{content: '<string>', role: '<string>', name: '<string>'}],
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}, strict: true},
type: '<string>'
}
],
additional_histories: [
{
messages_and_choices: [{content: '<string>', role: '<string>', name: '<string>'}],
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}, strict: true},
type: '<string>'
}
]
}
],
reward: 0,
initial_policy_version: 123,
final_policy_version: 123,
metrics: {},
metadata: {},
logs: ['<string>'],
start_time: '2023-11-07T05:31:56Z'
}
],
exceptions: [{type: '<string>', message: '<string>', traceback: '<string>'}],
metadata: {},
metrics: {},
logs: ['<string>']
}
],
experimental_config: {
advantage_balance: 123,
allow_training_without_logprobs: true,
epsilon: 123,
epsilon_high: 123,
kimi_k2_tau: 123,
kl_penalty_coef: 123,
kl_penalty_reference_step: 123,
kl_penalty_step_lag: 123,
kl_ref_adapter_path: '<string>',
learning_rate: 123,
logprob_calculation_chunk_size: 123,
mask_prob_ratio: true,
max_negative_advantage_importance_sampling_weight: 123,
normalize_advantages: true,
num_trajectories_learning_rate_multiplier_power: 123,
packed_sequence_length: 123,
plot_tensors: true,
ppo: true,
precalculate_logprobs: true,
scale_learning_rate_by_reward_std_dev: true,
scale_rewards: true,
truncated_importance_sampling: 123
}
})
};
fetch('https://api.training.wandb.ai/v1/preview/training-jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.training.wandb.ai/v1/preview/training-jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'trajectory_groups' => [
[
'trajectories' => [
[
'exchanges' => [
'chat_completions' => [
[
'request' => [
'model' => '<string>',
'messages' => [
[
'content' => '<string>',
'role' => '<string>',
'name' => '<string>'
]
],
'stream' => true,
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
],
'type' => '<string>'
]
],
'max_completion_tokens' => 123,
'max_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'logprobs' => true,
'top_logprobs' => 123,
'chat_template' => '<string>',
'chat_template_kwargs' => [
]
],
'response' => [
'id' => '<string>',
'choices' => [
[
'index' => 123,
'message' => [
'role' => '<string>',
'content' => '<string>',
'refusal' => '<string>',
'annotations' => [
[
'type' => '<string>',
'url_citation' => [
'end_index' => 123,
'start_index' => 123,
'title' => '<string>',
'url' => '<string>'
]
]
],
'audio' => [
'id' => '<string>',
'data' => '<string>',
'expires_at' => 123,
'transcript' => '<string>'
],
'function_call' => [
'arguments' => '<string>',
'name' => '<string>'
],
'tool_calls' => [
[
'id' => '<string>',
'function' => [
'arguments' => '<string>',
'name' => '<string>'
],
'type' => '<string>'
]
]
],
'logprobs' => [
'content' => [
[
'token' => '<string>',
'logprob' => 123,
'top_logprobs' => [
[
'token' => '<string>',
'logprob' => 123,
'bytes' => [
123
]
]
],
'bytes' => [
123
]
]
],
'refusal' => [
[
'token' => '<string>',
'logprob' => 123,
'top_logprobs' => [
[
'token' => '<string>',
'logprob' => 123,
'bytes' => [
123
]
]
],
'bytes' => [
123
]
]
]
]
]
],
'created' => 123,
'model' => '<string>',
'object' => '<string>',
'system_fingerprint' => '<string>',
'usage' => [
'completion_tokens' => 123,
'prompt_tokens' => 123,
'total_tokens' => 123,
'completion_tokens_details' => [
'accepted_prediction_tokens' => 123,
'audio_tokens' => 123,
'reasoning_tokens' => 123,
'rejected_prediction_tokens' => 123
],
'prompt_tokens_details' => [
'audio_tokens' => 123,
'cached_tokens' => 123
]
]
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
],
'completions' => [
[
'request' => [
'model' => '<string>',
'prompt' => '<string>',
'stream' => true,
'max_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'logprobs' => 123,
'echo' => true,
'stop' => '<string>',
'seed' => 123
],
'response' => [
'id' => '<string>',
'choices' => [
[
'index' => 123,
'text' => '<string>',
'logprobs' => [
'text_offset' => [
123
],
'token_logprobs' => [
123
],
'tokens' => [
'<string>'
],
'top_logprobs' => [
[
]
]
]
]
],
'created' => 123,
'model' => '<string>',
'object' => '<string>',
'system_fingerprint' => '<string>',
'usage' => [
'completion_tokens' => 123,
'prompt_tokens' => 123,
'total_tokens' => 123,
'completion_tokens_details' => [
'accepted_prediction_tokens' => 123,
'audio_tokens' => 123,
'reasoning_tokens' => 123,
'rejected_prediction_tokens' => 123
],
'prompt_tokens_details' => [
'audio_tokens' => 123,
'cached_tokens' => 123
]
]
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
],
'responses' => [
[
'request' => [
'model' => '<string>',
'input' => '<string>',
'instructions' => '<string>',
'previous_response_id' => '<string>',
'stream' => true,
'tools' => [
[
'name' => '<string>',
'parameters' => [
],
'strict' => true,
'type' => '<string>',
'description' => '<string>'
]
],
'max_output_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'chat_template' => '<string>',
'chat_template_kwargs' => [
]
],
'response' => [
'id' => '<string>',
'created_at' => 123,
'model' => '<string>',
'object' => '<string>',
'output' => [
[
'id' => '<string>',
'content' => [
[
'annotations' => [
[
'file_id' => '<string>',
'filename' => '<string>',
'index' => 123,
'type' => '<string>'
]
],
'text' => '<string>',
'type' => '<string>',
'logprobs' => [
[
'token' => '<string>',
'bytes' => [
123
],
'logprob' => 123,
'top_logprobs' => [
[
'token' => '<string>',
'bytes' => [
123
],
'logprob' => 123
]
]
]
]
]
],
'role' => '<string>',
'type' => '<string>'
]
],
'parallel_tool_calls' => true,
'tools' => [
[
'name' => '<string>',
'type' => '<string>',
'parameters' => [
],
'strict' => true,
'description' => '<string>'
]
],
'error' => [
'message' => '<string>'
],
'incomplete_details' => [
],
'instructions' => '<string>',
'metadata' => [
],
'temperature' => 123,
'top_p' => 123,
'background' => true,
'conversation' => [
'id' => '<string>'
],
'max_output_tokens' => 123,
'max_tool_calls' => 123,
'previous_response_id' => '<string>',
'prompt' => [
'id' => '<string>',
'variables' => [
],
'version' => '<string>'
],
'prompt_cache_key' => '<string>',
'reasoning' => [
],
'safety_identifier' => '<string>',
'text' => [
'format' => [
'type' => '<string>'
]
],
'top_logprobs' => 123,
'usage' => [
'input_tokens' => 123,
'input_tokens_details' => [
'cached_tokens' => 123
],
'output_tokens' => 123,
'output_tokens_details' => [
'reasoning_tokens' => 123
],
'total_tokens' => 123
],
'user' => '<string>'
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
],
'messages' => [
[
'request' => [
'model' => '<string>',
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 123,
'stream' => true,
'system' => '<string>',
'tools' => [
[
'input_schema' => [
'type' => '<string>',
'properties' => [
],
'required' => [
'<string>'
]
],
'name' => '<string>',
'allowed_callers' => [
],
'cache_control' => [
'type' => '<string>'
],
'defer_loading' => true,
'description' => '<string>',
'eager_input_streaming' => true,
'input_examples' => [
[
]
],
'strict' => true,
'type' => '<string>'
]
],
'thinking' => [
'budget_tokens' => 123,
'type' => '<string>'
],
'temperature' => 123,
'top_p' => 123,
'top_k' => 123,
'stop_sequences' => [
'<string>'
],
'chat_template' => '<string>',
'chat_template_kwargs' => [
]
],
'response' => [
'id' => '<string>',
'content' => [
[
'text' => '<string>',
'type' => '<string>',
'citations' => [
[
'cited_text' => '<string>',
'document_index' => 123,
'end_char_index' => 123,
'start_char_index' => 123,
'type' => '<string>',
'document_title' => '<string>',
'file_id' => '<string>'
]
]
]
],
'role' => '<string>',
'type' => '<string>',
'usage' => [
'input_tokens' => 123,
'output_tokens' => 123,
'cache_creation' => [
'ephemeral_1h_input_tokens' => 123,
'ephemeral_5m_input_tokens' => 123
],
'cache_creation_input_tokens' => 123,
'cache_read_input_tokens' => 123,
'inference_geo' => '<string>',
'output_tokens_details' => [
'thinking_tokens' => 123
],
'server_tool_use' => [
'web_fetch_requests' => 123,
'web_search_requests' => 123
]
],
'container' => [
'id' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
],
'stop_details' => [
'type' => '<string>',
'explanation' => '<string>'
],
'stop_sequence' => '<string>'
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z'
]
]
],
'messages_and_choices' => [
[
'content' => '<string>',
'role' => '<string>',
'name' => '<string>'
]
],
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
],
'type' => '<string>'
]
],
'additional_histories' => [
[
'messages_and_choices' => [
[
'content' => '<string>',
'role' => '<string>',
'name' => '<string>'
]
],
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
],
'type' => '<string>'
]
]
]
],
'reward' => 0,
'initial_policy_version' => 123,
'final_policy_version' => 123,
'metrics' => [
],
'metadata' => [
],
'logs' => [
'<string>'
],
'start_time' => '2023-11-07T05:31:56Z'
]
],
'exceptions' => [
[
'type' => '<string>',
'message' => '<string>',
'traceback' => '<string>'
]
],
'metadata' => [
],
'metrics' => [
],
'logs' => [
'<string>'
]
]
],
'experimental_config' => [
'advantage_balance' => 123,
'allow_training_without_logprobs' => true,
'epsilon' => 123,
'epsilon_high' => 123,
'kimi_k2_tau' => 123,
'kl_penalty_coef' => 123,
'kl_penalty_reference_step' => 123,
'kl_penalty_step_lag' => 123,
'kl_ref_adapter_path' => '<string>',
'learning_rate' => 123,
'logprob_calculation_chunk_size' => 123,
'mask_prob_ratio' => true,
'max_negative_advantage_importance_sampling_weight' => 123,
'normalize_advantages' => true,
'num_trajectories_learning_rate_multiplier_power' => 123,
'packed_sequence_length' => 123,
'plot_tensors' => true,
'ppo' => true,
'precalculate_logprobs' => true,
'scale_learning_rate_by_reward_std_dev' => true,
'scale_rewards' => true,
'truncated_importance_sampling' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.training.wandb.ai/v1/preview/training-jobs"
payload := strings.NewReader("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"trajectory_groups\": [\n {\n \"trajectories\": [\n {\n \"exchanges\": {\n \"chat_completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"max_completion_tokens\": 123,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"message\": {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"refusal\": \"<string>\",\n \"annotations\": [\n {\n \"type\": \"<string>\",\n \"url_citation\": {\n \"end_index\": 123,\n \"start_index\": 123,\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n }\n ],\n \"audio\": {\n \"id\": \"<string>\",\n \"data\": \"<string>\",\n \"expires_at\": 123,\n \"transcript\": \"<string>\"\n },\n \"function_call\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n }\n ]\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ],\n \"refusal\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"stream\": true,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": 123,\n \"echo\": true,\n \"stop\": \"<string>\",\n \"seed\": 123\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"text\": \"<string>\",\n \"logprobs\": {\n \"text_offset\": [\n 123\n ],\n \"token_logprobs\": [\n 123\n ],\n \"tokens\": [\n \"<string>\"\n ],\n \"top_logprobs\": [\n {}\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"responses\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"max_output_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"created_at\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"output\": [\n {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"annotations\": [\n {\n \"file_id\": \"<string>\",\n \"filename\": \"<string>\",\n \"index\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123\n }\n ]\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"error\": {\n \"message\": \"<string>\"\n },\n \"incomplete_details\": {},\n \"instructions\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"background\": true,\n \"conversation\": {\n \"id\": \"<string>\"\n },\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"<string>\"\n }\n },\n \"top_logprobs\": 123,\n \"usage\": {\n \"input_tokens\": 123,\n \"input_tokens_details\": {\n \"cached_tokens\": 123\n },\n \"output_tokens\": 123,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 123\n },\n \"total_tokens\": 123\n },\n \"user\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"messages\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": true,\n \"system\": \"<string>\",\n \"tools\": [\n {\n \"input_schema\": {\n \"type\": \"<string>\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"allowed_callers\": [],\n \"cache_control\": {\n \"type\": \"<string>\"\n },\n \"defer_loading\": true,\n \"description\": \"<string>\",\n \"eager_input_streaming\": true,\n \"input_examples\": [\n {}\n ],\n \"strict\": true,\n \"type\": \"<string>\"\n }\n ],\n \"thinking\": {\n \"budget_tokens\": 123,\n \"type\": \"<string>\"\n },\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"citations\": [\n {\n \"cited_text\": \"<string>\",\n \"document_index\": 123,\n \"end_char_index\": 123,\n \"start_char_index\": 123,\n \"type\": \"<string>\",\n \"document_title\": \"<string>\",\n \"file_id\": \"<string>\"\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\",\n \"usage\": {\n \"input_tokens\": 123,\n \"output_tokens\": 123,\n \"cache_creation\": {\n \"ephemeral_1h_input_tokens\": 123,\n \"ephemeral_5m_input_tokens\": 123\n },\n \"cache_creation_input_tokens\": 123,\n \"cache_read_input_tokens\": 123,\n \"inference_geo\": \"<string>\",\n \"output_tokens_details\": {\n \"thinking_tokens\": 123\n },\n \"server_tool_use\": {\n \"web_fetch_requests\": 123,\n \"web_search_requests\": 123\n }\n },\n \"container\": {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n },\n \"stop_details\": {\n \"type\": \"<string>\",\n \"explanation\": \"<string>\"\n },\n \"stop_sequence\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"additional_histories\": [\n {\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ]\n }\n ],\n \"reward\": 0,\n \"initial_policy_version\": 123,\n \"final_policy_version\": 123,\n \"metrics\": {},\n \"metadata\": {},\n \"logs\": [\n \"<string>\"\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"exceptions\": [\n {\n \"type\": \"<string>\",\n \"message\": \"<string>\",\n \"traceback\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"metrics\": {},\n \"logs\": [\n \"<string>\"\n ]\n }\n ],\n \"experimental_config\": {\n \"advantage_balance\": 123,\n \"allow_training_without_logprobs\": true,\n \"epsilon\": 123,\n \"epsilon_high\": 123,\n \"kimi_k2_tau\": 123,\n \"kl_penalty_coef\": 123,\n \"kl_penalty_reference_step\": 123,\n \"kl_penalty_step_lag\": 123,\n \"kl_ref_adapter_path\": \"<string>\",\n \"learning_rate\": 123,\n \"logprob_calculation_chunk_size\": 123,\n \"mask_prob_ratio\": true,\n \"max_negative_advantage_importance_sampling_weight\": 123,\n \"normalize_advantages\": true,\n \"num_trajectories_learning_rate_multiplier_power\": 123,\n \"packed_sequence_length\": 123,\n \"plot_tensors\": true,\n \"ppo\": true,\n \"precalculate_logprobs\": true,\n \"scale_learning_rate_by_reward_std_dev\": true,\n \"scale_rewards\": true,\n \"truncated_importance_sampling\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.training.wandb.ai/v1/preview/training-jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"trajectory_groups\": [\n {\n \"trajectories\": [\n {\n \"exchanges\": {\n \"chat_completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"max_completion_tokens\": 123,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"message\": {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"refusal\": \"<string>\",\n \"annotations\": [\n {\n \"type\": \"<string>\",\n \"url_citation\": {\n \"end_index\": 123,\n \"start_index\": 123,\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n }\n ],\n \"audio\": {\n \"id\": \"<string>\",\n \"data\": \"<string>\",\n \"expires_at\": 123,\n \"transcript\": \"<string>\"\n },\n \"function_call\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n }\n ]\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ],\n \"refusal\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"stream\": true,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": 123,\n \"echo\": true,\n \"stop\": \"<string>\",\n \"seed\": 123\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"text\": \"<string>\",\n \"logprobs\": {\n \"text_offset\": [\n 123\n ],\n \"token_logprobs\": [\n 123\n ],\n \"tokens\": [\n \"<string>\"\n ],\n \"top_logprobs\": [\n {}\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"responses\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"max_output_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"created_at\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"output\": [\n {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"annotations\": [\n {\n \"file_id\": \"<string>\",\n \"filename\": \"<string>\",\n \"index\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123\n }\n ]\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"error\": {\n \"message\": \"<string>\"\n },\n \"incomplete_details\": {},\n \"instructions\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"background\": true,\n \"conversation\": {\n \"id\": \"<string>\"\n },\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"<string>\"\n }\n },\n \"top_logprobs\": 123,\n \"usage\": {\n \"input_tokens\": 123,\n \"input_tokens_details\": {\n \"cached_tokens\": 123\n },\n \"output_tokens\": 123,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 123\n },\n \"total_tokens\": 123\n },\n \"user\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"messages\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": true,\n \"system\": \"<string>\",\n \"tools\": [\n {\n \"input_schema\": {\n \"type\": \"<string>\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"allowed_callers\": [],\n \"cache_control\": {\n \"type\": \"<string>\"\n },\n \"defer_loading\": true,\n \"description\": \"<string>\",\n \"eager_input_streaming\": true,\n \"input_examples\": [\n {}\n ],\n \"strict\": true,\n \"type\": \"<string>\"\n }\n ],\n \"thinking\": {\n \"budget_tokens\": 123,\n \"type\": \"<string>\"\n },\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"citations\": [\n {\n \"cited_text\": \"<string>\",\n \"document_index\": 123,\n \"end_char_index\": 123,\n \"start_char_index\": 123,\n \"type\": \"<string>\",\n \"document_title\": \"<string>\",\n \"file_id\": \"<string>\"\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\",\n \"usage\": {\n \"input_tokens\": 123,\n \"output_tokens\": 123,\n \"cache_creation\": {\n \"ephemeral_1h_input_tokens\": 123,\n \"ephemeral_5m_input_tokens\": 123\n },\n \"cache_creation_input_tokens\": 123,\n \"cache_read_input_tokens\": 123,\n \"inference_geo\": \"<string>\",\n \"output_tokens_details\": {\n \"thinking_tokens\": 123\n },\n \"server_tool_use\": {\n \"web_fetch_requests\": 123,\n \"web_search_requests\": 123\n }\n },\n \"container\": {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n },\n \"stop_details\": {\n \"type\": \"<string>\",\n \"explanation\": \"<string>\"\n },\n \"stop_sequence\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"additional_histories\": [\n {\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ]\n }\n ],\n \"reward\": 0,\n \"initial_policy_version\": 123,\n \"final_policy_version\": 123,\n \"metrics\": {},\n \"metadata\": {},\n \"logs\": [\n \"<string>\"\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"exceptions\": [\n {\n \"type\": \"<string>\",\n \"message\": \"<string>\",\n \"traceback\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"metrics\": {},\n \"logs\": [\n \"<string>\"\n ]\n }\n ],\n \"experimental_config\": {\n \"advantage_balance\": 123,\n \"allow_training_without_logprobs\": true,\n \"epsilon\": 123,\n \"epsilon_high\": 123,\n \"kimi_k2_tau\": 123,\n \"kl_penalty_coef\": 123,\n \"kl_penalty_reference_step\": 123,\n \"kl_penalty_step_lag\": 123,\n \"kl_ref_adapter_path\": \"<string>\",\n \"learning_rate\": 123,\n \"logprob_calculation_chunk_size\": 123,\n \"mask_prob_ratio\": true,\n \"max_negative_advantage_importance_sampling_weight\": 123,\n \"normalize_advantages\": true,\n \"num_trajectories_learning_rate_multiplier_power\": 123,\n \"packed_sequence_length\": 123,\n \"plot_tensors\": true,\n \"ppo\": true,\n \"precalculate_logprobs\": true,\n \"scale_learning_rate_by_reward_std_dev\": true,\n \"scale_rewards\": true,\n \"truncated_importance_sampling\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.training.wandb.ai/v1/preview/training-jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"trajectory_groups\": [\n {\n \"trajectories\": [\n {\n \"exchanges\": {\n \"chat_completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"max_completion_tokens\": 123,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"message\": {\n \"role\": \"<string>\",\n \"content\": \"<string>\",\n \"refusal\": \"<string>\",\n \"annotations\": [\n {\n \"type\": \"<string>\",\n \"url_citation\": {\n \"end_index\": 123,\n \"start_index\": 123,\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n }\n ],\n \"audio\": {\n \"id\": \"<string>\",\n \"data\": \"<string>\",\n \"expires_at\": 123,\n \"transcript\": \"<string>\"\n },\n \"function_call\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"function\": {\n \"arguments\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n }\n ]\n },\n \"logprobs\": {\n \"content\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ],\n \"refusal\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"logprob\": 123,\n \"bytes\": [\n 123\n ]\n }\n ],\n \"bytes\": [\n 123\n ]\n }\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"completions\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"stream\": true,\n \"max_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"logprobs\": 123,\n \"echo\": true,\n \"stop\": \"<string>\",\n \"seed\": 123\n },\n \"response\": {\n \"id\": \"<string>\",\n \"choices\": [\n {\n \"index\": 123,\n \"text\": \"<string>\",\n \"logprobs\": {\n \"text_offset\": [\n 123\n ],\n \"token_logprobs\": [\n 123\n ],\n \"tokens\": [\n \"<string>\"\n ],\n \"top_logprobs\": [\n {}\n ]\n }\n }\n ],\n \"created\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"system_fingerprint\": \"<string>\",\n \"usage\": {\n \"completion_tokens\": 123,\n \"prompt_tokens\": 123,\n \"total_tokens\": 123,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 123,\n \"audio_tokens\": 123,\n \"reasoning_tokens\": 123,\n \"rejected_prediction_tokens\": 123\n },\n \"prompt_tokens_details\": {\n \"audio_tokens\": 123,\n \"cached_tokens\": 123\n }\n }\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"responses\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"max_output_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"created_at\": 123,\n \"model\": \"<string>\",\n \"object\": \"<string>\",\n \"output\": [\n {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"annotations\": [\n {\n \"file_id\": \"<string>\",\n \"filename\": \"<string>\",\n \"index\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123,\n \"top_logprobs\": [\n {\n \"token\": \"<string>\",\n \"bytes\": [\n 123\n ],\n \"logprob\": 123\n }\n ]\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"error\": {\n \"message\": \"<string>\"\n },\n \"incomplete_details\": {},\n \"instructions\": \"<string>\",\n \"metadata\": {},\n \"temperature\": 123,\n \"top_p\": 123,\n \"background\": true,\n \"conversation\": {\n \"id\": \"<string>\"\n },\n \"max_output_tokens\": 123,\n \"max_tool_calls\": 123,\n \"previous_response_id\": \"<string>\",\n \"prompt\": {\n \"id\": \"<string>\",\n \"variables\": {},\n \"version\": \"<string>\"\n },\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"text\": {\n \"format\": {\n \"type\": \"<string>\"\n }\n },\n \"top_logprobs\": 123,\n \"usage\": {\n \"input_tokens\": 123,\n \"input_tokens_details\": {\n \"cached_tokens\": 123\n },\n \"output_tokens\": 123,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 123\n },\n \"total_tokens\": 123\n },\n \"user\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"messages\": [\n {\n \"request\": {\n \"model\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 123,\n \"stream\": true,\n \"system\": \"<string>\",\n \"tools\": [\n {\n \"input_schema\": {\n \"type\": \"<string>\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ]\n },\n \"name\": \"<string>\",\n \"allowed_callers\": [],\n \"cache_control\": {\n \"type\": \"<string>\"\n },\n \"defer_loading\": true,\n \"description\": \"<string>\",\n \"eager_input_streaming\": true,\n \"input_examples\": [\n {}\n ],\n \"strict\": true,\n \"type\": \"<string>\"\n }\n ],\n \"thinking\": {\n \"budget_tokens\": 123,\n \"type\": \"<string>\"\n },\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"chat_template\": \"<string>\",\n \"chat_template_kwargs\": {}\n },\n \"response\": {\n \"id\": \"<string>\",\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"<string>\",\n \"citations\": [\n {\n \"cited_text\": \"<string>\",\n \"document_index\": 123,\n \"end_char_index\": 123,\n \"start_char_index\": 123,\n \"type\": \"<string>\",\n \"document_title\": \"<string>\",\n \"file_id\": \"<string>\"\n }\n ]\n }\n ],\n \"role\": \"<string>\",\n \"type\": \"<string>\",\n \"usage\": {\n \"input_tokens\": 123,\n \"output_tokens\": 123,\n \"cache_creation\": {\n \"ephemeral_1h_input_tokens\": 123,\n \"ephemeral_5m_input_tokens\": 123\n },\n \"cache_creation_input_tokens\": 123,\n \"cache_read_input_tokens\": 123,\n \"inference_geo\": \"<string>\",\n \"output_tokens_details\": {\n \"thinking_tokens\": 123\n },\n \"server_tool_use\": {\n \"web_fetch_requests\": 123,\n \"web_search_requests\": 123\n }\n },\n \"container\": {\n \"id\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n },\n \"stop_details\": {\n \"type\": \"<string>\",\n \"explanation\": \"<string>\"\n },\n \"stop_sequence\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\"\n }\n ]\n },\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ],\n \"additional_histories\": [\n {\n \"messages_and_choices\": [\n {\n \"content\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n },\n \"type\": \"<string>\"\n }\n ]\n }\n ],\n \"reward\": 0,\n \"initial_policy_version\": 123,\n \"final_policy_version\": 123,\n \"metrics\": {},\n \"metadata\": {},\n \"logs\": [\n \"<string>\"\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"exceptions\": [\n {\n \"type\": \"<string>\",\n \"message\": \"<string>\",\n \"traceback\": \"<string>\"\n }\n ],\n \"metadata\": {},\n \"metrics\": {},\n \"logs\": [\n \"<string>\"\n ]\n }\n ],\n \"experimental_config\": {\n \"advantage_balance\": 123,\n \"allow_training_without_logprobs\": true,\n \"epsilon\": 123,\n \"epsilon_high\": 123,\n \"kimi_k2_tau\": 123,\n \"kl_penalty_coef\": 123,\n \"kl_penalty_reference_step\": 123,\n \"kl_penalty_step_lag\": 123,\n \"kl_ref_adapter_path\": \"<string>\",\n \"learning_rate\": 123,\n \"logprob_calculation_chunk_size\": 123,\n \"mask_prob_ratio\": true,\n \"max_negative_advantage_importance_sampling_weight\": 123,\n \"normalize_advantages\": true,\n \"num_trajectories_learning_rate_multiplier_power\": 123,\n \"packed_sequence_length\": 123,\n \"plot_tensors\": true,\n \"ppo\": true,\n \"precalculate_logprobs\": true,\n \"scale_learning_rate_by_reward_std_dev\": true,\n \"scale_rewards\": true,\n \"truncated_importance_sampling\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Successful Response
Schema for TrainingJob response.
Was this page helpful?
⌘I