Skip to content

Commit

Permalink
(fix): rollback ruff formatting (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Jun 19, 2024
1 parent 33b409e commit 0b96fe8
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 93 deletions.
2 changes: 1 addition & 1 deletion packages/template-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "vitest --run --passWithNoTests"
},
"dependencies": {
"@wasm-fmt/ruff_fmt": "^0.5.10"
"prettier": "^2.8.8"
},
"devDependencies": {
"@fern-platform/configs": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Snippet Template Resolver > Empty payload 1`] = `
"from elevenlabs.client import AsyncElevenLabs
"
from elevenlabs.client import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
await client.voices.get_all(
)
await client.voices.get_all()
"
`;

exports[`Snippet Template Resolver > Test Chat Completion snippet 1`] = `
"from octoai.client import AsyncOctoAI
"
from octoai.client import AsyncOctoAI
client = AsyncOctoAI(
api_key="YOUR_API_KEY",
)
await client.text_gen.create_chat_completion_stream(
max_tokens=512,
messages=[],
model="qwen1.5-32b-chat",
presence_penalty=0,
temperature=0.1,
top_p=0.9,
max_tokens=512,
messages=[],
model="qwen1.5-32b-chat",
presence_penalty=0,
temperature=0.1,
top_p=0.9
)
"
`;
Expand All @@ -33,16 +39,16 @@ exports[`Snippet Template Resolver > Test Snippet Template Resolution 1`] = `
from octoai import AsyncAcme
client = AsyncAcme(api_key="YOUR_API_KEY")
client = AsyncAcme(api_key='YOUR_API_KEY')
client.image_gen.generate_sdxl(
ImageGenerationRequest(
prompt="A prompt",
negative_prompt="A negative prompt",
tune_id="someId",
offset="10",
output_format="pcm_16000",
loras={"key1": "value1", "key2": "value2"},
)
ImageGenerationRequest(
prompt="A prompt",
negative_prompt="A negative prompt",
tune_id="someId",
offset="10",
output_format="pcm_16000",
loras={"key1": "value1", "key2": "value2"}
)
)
"
`;
9 changes: 0 additions & 9 deletions packages/template-resolver/src/formatSnippet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import init, { format } from "@wasm-fmt/ruff_fmt";
import * as prettier from "prettier";
import { Snippet } from "./generated/api";

Expand All @@ -11,14 +10,6 @@ export async function formatSnippet(snippet: Snippet): Promise<Snippet> {
client,
};
}
case "python": {
await init();
return {
...snippet,
sync_client: format(snippet.sync_client),
async_client: format(snippet.async_client),
};
}
default:
return snippet;
}
Expand Down
Loading

0 comments on commit 0b96fe8

Please sign in to comment.