mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
Allow assigning teams to org on UI + OpenAI omni-moderation
cost model tracking (#7566)
* feat(cost_calculator.py): add cost tracking ($0) for openai moderations endpoint removes sentry cost tracking errors caused by this * build(teams.tsx): allow assigning teams to orgs
This commit is contained in:
parent
b769b826d0
commit
12a78fe05f
5 changed files with 227 additions and 141 deletions
|
@ -35,6 +35,9 @@ import {
|
|||
Col,
|
||||
Text,
|
||||
Grid,
|
||||
Accordion,
|
||||
AccordionHeader,
|
||||
AccordionBody,
|
||||
} from "@tremor/react";
|
||||
import { CogIcon } from "@heroicons/react/outline";
|
||||
const isLocal = process.env.NODE_ENV === "development";
|
||||
|
@ -365,6 +368,13 @@ const Team: React.FC<TeamProps> = ({
|
|||
if (accessToken != null) {
|
||||
const newTeamAlias = formValues?.team_alias;
|
||||
const existingTeamAliases = teams?.map((t) => t.team_alias) ?? [];
|
||||
let organizationId = formValues?.organization_id;
|
||||
if (organizationId === "" || typeof organizationId !== 'string') {
|
||||
formValues.organization_id = null;
|
||||
} else {
|
||||
formValues.organization_id = organizationId.trim();
|
||||
}
|
||||
|
||||
|
||||
if (existingTeamAliases.includes(newTeamAlias)) {
|
||||
throw new Error(
|
||||
|
@ -731,6 +741,25 @@ const Team: React.FC<TeamProps> = ({
|
|||
>
|
||||
<InputNumber step={1} width={400} />
|
||||
</Form.Item>
|
||||
<Accordion className="mt-20 mb-8">
|
||||
<AccordionHeader>
|
||||
<b>Additional Settings</b>
|
||||
</AccordionHeader>
|
||||
<AccordionBody>
|
||||
<Form.Item
|
||||
label="Organization ID"
|
||||
name="organization_id"
|
||||
help="Assign team to an organization. Found in the 'Organization' tab."
|
||||
>
|
||||
<TextInput
|
||||
placeholder=""
|
||||
onChange={(e) => {
|
||||
e.target.value = e.target.value.trim();
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
</AccordionBody>
|
||||
</Accordion>
|
||||
</>
|
||||
<div style={{ textAlign: "right", marginTop: "10px" }}>
|
||||
<Button2 htmlType="submit">Create Team</Button2>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue