Skip to content

Instantly share code, notes, and snippets.

class CustomSmartPasteInference : SmartPasteInference
{
public override ChatParameters BuildPrompt(SmartPasteRequestData data)
{
string text = "\nCurrent date: " + DateTime.Today.ToString("D", CultureInfo.InvariantCulture) + "\n\nEach response line matches the following format:\nFIELD identifier^^^value\n\nGive a response with the following lines only, with values inferred from USER_DATA:\n" + ToSimplifiedOutputExamples(data.FormFields) + "\nEND_RESPONSE\n\nDo not explain how the values were determined.\nFor fields without any corresponding information in USER_DATA, use value value NO_DATA.";
string text2 = "\nUSER_DATA: " + data.ClipboardContents + "\n";
var prompt= new ChatParameters
{
Messages = new List<ChatMessage>(2)
{
builder.Services.AddSingleton<SmartPasteInference, CustomSmartPasteInference>();
builder.Services.AddSmartComponents()
.WithInferenceBackend<OpenAIInferenceBackend>();
class CustomSmartPasteInference : SmartPasteInference
{
public override ChatParameters BuildPrompt(SmartPasteRequestData data)
{
var prompt = base.BuildPrompt(data);
return prompt;
}
}
<form>
<!-- Removed the other fields -->
<smart-paste-button default-icon>Paste from clipboard</smart-paste-button>
</form>
<form>
<div class="form-group">
<label for="title">Title</label>
<input type="text" class="form-control" id="title" name="title" required data-smartpaste-description="Oneliner summary describing the most important aspect of the identified bug">
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control" id="description" name="description" required></textarea>
</div>
<div class="form-group">
public class CalculatorTests
{
[Theory]
[MemberData(nameof(TestData))]
public void CanAdd(int value1, int value2, int expected)
{
var calculator = new Calculator();
var result = calculator.Add(value1, value2);
Assert.Equal(expected, result);
}
public class CalculatorTests
{
[Theory]
[MemberData(nameof(TestData))]
public void CanAdd(int value1, int value2, int expected)
{
var calculator = new Calculator();
var result = calculator.Add(value1, value2);
Assert.Equal(expected, result);
}
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzureCLI@2
inputs:
azureSubscription: '<Your-Azure-Subscription-Service-Connection>'
- name: Ensure resource group exists
uses: azure/CLI@v1
with:
inlineScript: |
az group create -g ${{ secrets.RESOURCE_GROUP }} -l ${{ secrets.RESOURCE_GROUP_LOCATION }}
- name: Deploy Bicep
uses: azure/arm-deploy@v1
with:
resourceGroupName: ${{ secrets.RESOURCE_GROUP }}
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
param name string
param location string = resourceGroup().location
resource astro_swa 'Microsoft.Web/staticSites@2022-09-01' = {
name: name
location: location
sku: {
name: 'Free'
tier: 'Free'
}