$headers = @{"Authorization" = "Bearer sk-413a8289cada4695a18d8982e5f63f3c"; "Content-Type" = "application/json"} $messages = @( @{ role = "system"; content = "You are an entity relation expert. Extract persons, events, topics, relations from text. Return JSON only: {persons:[],events:[],topics:[],relations:[]}" } @{ role = "user"; content = "I had a fight with her today. She said I did not buy her flowers the day before yesterday and said my marriage proposal was too casual" } ) $body = @{ model = "qwen-plus"; messages = $messages; temperature = 0.7 } | ConvertTo-Json -Depth 10 $response = Invoke-RestMethod -Uri "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions" -Method Post -Headers $headers -Body $body $response.choices[0].message.content