-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prompts): Add Anthropic code snippets to prompt details (#6341)
* refactor(prompts): Improve code snippet generation with language-specific configs * feat(prompts): Add Anthropic code snippets They still need to be validated, and tests need to be added * Add tests for anthropic snippet generation * Fix tool choice * Properly render tool choice in code snippet * Add openai tests * comments
- Loading branch information
1 parent
a876472
commit c60b77d
Showing
5 changed files
with
1,222 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import type { PromptCodeExportCard__main$data as PromptVersion } from "../__generated__/PromptCodeExportCard__main.graphql"; | ||
|
||
export type FixturePromptVersion = Omit<PromptVersion, " $fragmentType">; | ||
|
||
export const BASE_MOCK_PROMPT_VERSION = { | ||
modelProvider: "OPENAI", | ||
modelName: "gpt-4", | ||
templateType: "CHAT", | ||
templateFormat: "MUSTACHE", | ||
template: { | ||
__typename: "PromptChatTemplate", | ||
messages: [ | ||
{ | ||
role: "USER", | ||
content: [{ __typename: "TextContentPart", text: { text: "Hello" } }], | ||
}, | ||
], | ||
}, | ||
invocationParameters: { | ||
temperature: 0.7, | ||
}, | ||
tools: [], | ||
responseFormat: null, | ||
} satisfies FixturePromptVersion; | ||
|
||
export const OPENAI_TOOL = { | ||
type: "function", | ||
function: { | ||
name: "test", | ||
description: "test function", | ||
parameters: { | ||
type: "object", | ||
properties: { | ||
foo: { | ||
type: "string", | ||
}, | ||
}, | ||
required: ["foo"], | ||
}, | ||
}, | ||
}; | ||
|
||
export const ANTHROPIC_TOOL = { | ||
name: "test", | ||
description: "test function", | ||
input: { | ||
type: "object", | ||
properties: { | ||
foo: { type: "string" }, | ||
}, | ||
}, | ||
}; | ||
|
||
export const OPENAI_RESPONSE_FORMAT = { | ||
type: "json_schema", | ||
json_schema: { | ||
name: "test_format", | ||
description: "test format", | ||
schema: { | ||
type: "object", | ||
properties: { | ||
format: { type: "string" }, | ||
}, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.