Skip to content

Commit

Permalink
initial provoder
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD committed Feb 20, 2025
1 parent 87bd5a7 commit 6ce241d
Show file tree
Hide file tree
Showing 7 changed files with 791 additions and 15 deletions.
30 changes: 26 additions & 4 deletions ell-studio/src/hooks/useBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,13 @@ export const useEvaluations = (page = 0, pageSize = 100) => {
queryKey: ["evaluations", page, pageSize],
queryFn: async () => {
const response = await axios.get(`${API_BASE_URL}/api/evaluations?skip=${page * pageSize}&limit=${pageSize}`);
return response.data;
const data= response.data;
return data.map((evaluation) => {
return {
...evaluation,
runs: evaluation.runs.filter((run) => run.evaluated_lmp !== null),
}
})
},
});
};
Expand All @@ -254,7 +260,13 @@ export const useLatestEvaluations = (page = 0, pageSize = 100) => {
queryKey: ["latestEvaluations", page, pageSize],
queryFn: async () => {
const response = await axios.get(`${API_BASE_URL}/api/latest/evaluations?skip=${page * pageSize}&limit=${pageSize}`);
return response.data;
const data= response.data;
return data.map((evaluation) => {
return {
...evaluation,
runs: evaluation.runs.filter((run) => run.evaluated_lmp !== null),
}
})
},
});
};
Expand All @@ -264,7 +276,11 @@ export const useEvaluation = (id) => {
queryKey: ["evaluation", id],
queryFn: async () => {
const response = await axios.get(`${API_BASE_URL}/api/evaluation/${id}`);
return response.data;
const data = response.data;
return {
...data,
runs: data.runs.filter((run) => run.evaluated_lmp !== null),
};
},
enabled: !!id,
});
Expand All @@ -276,7 +292,13 @@ export const useEvaluationRuns = (evaluationId, page = 0, pageSize = 10) => {
queryFn: async () => {
const skip = page * pageSize;
const response = await axios.get(`${API_BASE_URL}/api/evaluations/${evaluationId}/runs?skip=${skip}&limit=${pageSize}`);
return response.data;
const data = response.data;
return data.map((run) => {
return {
...run,
evaluated_lmp: run.evaluated_lmp ? run.evaluated_lmp : null,
}
})
},
enabled: !!evaluationId,
});
Expand Down
16 changes: 16 additions & 0 deletions examples/providers/gemini_ex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
Google Gemini example: pip install ell-ai[google]
"""
import ell
from google import genai

ell.init(verbose=True)

# custom client
client = genai.Client()

@ell.simple(model='gemini-2.0-flash', client=client, max_tokens=10)
def chat(prompt: str) -> str:
return prompt

print(chat("Hello, how are you?"))
Loading

0 comments on commit 6ce241d

Please sign in to comment.