Listing 1: Anschluss der REST-API von OpenAI ## A: Ein einfacher Test für Windows, Linux und macOS curl 'https://api.openai.com/v1/models' -H 'Authorization: Bearer sk-projTBpYmThrjWmfhRJBM6D-RZi1Xgp_DAxeMvoqoPTcJoz' ## B: Linux: Curl/JQ export OPENAI_API_KEY='sk-projTBpYmThrjWmfhRJBM6D-RZi1Xgp_DAxeMvoqoPTcJoz' curl 'https://api.openai.com/v1/models' -H "Authorization: Bearer $OPENAI_API_KEY" | jq -r '.data[].id' | sort ## C: Windows & PowerShell $OPENAI_API_KEY='sk-proj-TBpYmThrjWmfhRJBM6DRZi1Xgp_DAxeMvoqoPTcJoz' Invoke-RestMethod -Uri 'https://api.openai.com/v1/models' -Headers @{Authorization = "Bearer $OPENAI_API_KEY" } | Select-Object -ExpandProperty 'data' | Sort-Object -Property 'id' Listing 2: Fibonacci-Berechnung ## Prompt 1 ## Erstelle eine Funktion zur Berechnung der Fibonacci-Reihe! ## Prompt 2 ## Ich möchte in der Ausgabe großer Zahlen keine Exponentialschreibweise verwenden. ## Das abschließende Ergebnis function Get-Fibonacci { param ( [int]$n ) $fib = [System.Collections.Generic. List[bigint]]@(1, 1) for ($i = 2; $i -lt $n; $i++) { $fib.Add([bigint]($fib[$i - 1] + $fib[$i - 2])) } return $fib } # Beispiel: Berechnung der ersten zehn natürlichen Fibonacci-Zahlen Get-Fibonacci -n 10 Listing 3: Weitere Anbieter in openai.agent.json konfigurieren "GPTs": [ { "Name": "ps-az-gpt4", "Description": "A GPT instance gpt-4 running in Azure.", "Endpoint": "https://exampleendpoint.openai.azure.com", // Ihr Endpoint "Deployment": "gpt-4o", "ModelName": "gpt-4o", "Key": "5bdb6kpytniknqDymM5COD1jBdDMmavW", // Ihr Zugangsschlüssel "SystemPrompt": "Current model: gpt-4o (Azure AI Services)" }, { "Name": "gpt-deepseek", "Description": "A GPT instance using DeepSeek v3.", "Endpoint": "https://api.deepseek.com", "Deployment": null, "ModelName": "deepseek-chat", "Key": "sk-841d61bbed8a4703", // Ihr API Key "SystemPrompt": "Current model: deep seek-chat" } Listing 4: Frage und Antwort mittels Azure Copilot ## PROMPT: ## Wie weise ich eine M365-Lizenz einer EntraID zu? Wie mache ich dies in der PowerShell? ## ANTWORT vom Copilot in Azure: # To assign a Microsoft 365 license to an Entra ID using PowerShell # Step 1: Authenticate to your Microsoft 365 account to access resources Connect-MgGraph -Scopes "User.ReadWrite.All", "Directory.ReadWrite.All" # Step 2: Retrieve the user object from Microsoft Graph $user = Get-MgUser -UserId 'UserPrincipalName' # Replace 'UserPrincipalName' with the actual user's UPN # Step 3: Assign a Microsoft 365 license to the specified user # Note: Replace 'TenantLicenseSkuId' with the actual SKU ID of the license you want to assign $licenseSkuId = 'TenantLicenseSkuId' # Example: 'contoso:ENTERPRISEPACK' Set-MgUserLicense -UserId $user.Id -AddLicenses @{SkuId=$licenseSkuId}