Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: New eval quickstart #575

Merged
merged 15 commits into from
Dec 18, 2024
Merged

WIP: New eval quickstart #575

merged 15 commits into from
Dec 18, 2024

Conversation

davidx33
Copy link
Contributor

@davidx33 davidx33 commented Dec 6, 2024

new Quickstart for evaluations

Copy link

vercel bot commented Dec 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langsmith-docs ✅ Ready (Inspect) Visit Preview 2 resolved Dec 18, 2024 1:24am


const client = new Client();

const openai = new OpenAI();`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to match python

Suggested change
const openai = new OpenAI();`,
const openaiClient = new OpenAI();`,

Comment on lines +180 to +184
{ "role": "system", "content": "Answer the following question accurately" },
{ "role": "user", "content": inputs["question"] },
],
)
return { "response": response.choices[0].message.content.strip() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python formatting nit

Suggested change
{ "role": "system", "content": "Answer the following question accurately" },
{ "role": "user", "content": inputs["question"] },
],
)
return { "response": response.choices[0].message.content.strip() }
{"role": "system", "content": "Answer the following question accurately"},
{"role": "user", "content": inputs["question"]},
],
)
return {"response": response.choices[0].message.content.strip()}

label: "TypeScript",
content: `// Define the application logic you want to evaluate inside a target function
// The SDK will automatically send the inputs from the dataset to your target function
async function target(inputs: string): Promise<{ response: string }> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is inputs not a Record in js as well? didnt' realize you could have a target that just takes a string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just deconstructed it into a string before I sent it over to target

Comment on lines +231 to +238
messages=[
{ "role": "system", "content": instructions },
{
"role": "user",
"content": f"""Ground Truth answer: {reference_outputs["answer"]};
Student's Answer: {outputs["response"]}"""
},
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting nit

Suggested change
messages=[
{ "role": "system", "content": instructions },
{
"role": "user",
"content": f"""Ground Truth answer: {reference_outputs["answer"]};
Student's Answer: {outputs["response"]}"""
},
],
to_evaluate = (
f"Ground Truth Answer: {reference_outputs['answer']}\n"
f"Student Answer: {outputs['response']}"
)
messages=[
{"role": "system", "content": instructions},
{"role": "user", "content": to_evaluate},
],

@davidx33 davidx33 merged commit 78b2b30 into main Dec 18, 2024
6 checks passed
@davidx33 davidx33 deleted the new-eval-quickstart branch December 18, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants